home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / unix / rcs.05 < prev    next >
Internet Message Format  |  1989-11-19  |  87KB

  1. Path: xanth!ames!apple!sun-barr!newstop!sun!swap!page
  2. From: page%swap@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i220:  rcs - revision control system, Part05/14
  5. Message-ID: <128096@sun.Eng.Sun.COM>
  6. Date: 19 Nov 89 09:24:43 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 2294
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: rsbx@cbmvax.commodore.com (Raymond S. Brand)
  12. Posting-number: Volume 89, Issue 220
  13. Archive-name: unix/rcs.05
  14.  
  15. # This is a shell archive.
  16. # Remove anything above and including the cut line.
  17. # Then run the rest of the file through 'sh'.
  18. # Unpacked files will be owned by you and have default permissions.
  19. #----cut here-----cut here-----cut here-----cut here----#
  20. #!/bin/sh
  21. # shar: SHell ARchive
  22. # Run the following text through 'sh' to create:
  23. #    doc/rcs.ms
  24. #    doc/rcs_functs.ms
  25. #    doc/ci.1l
  26. #    doc/co.1l
  27. #    doc/ident.1l
  28. #    doc/merge.1l
  29. # This is archive 5 of a 14-part kit.
  30. # This archive created: Sun Nov 19 01:12:06 1989
  31. if `test ! -d doc`
  32. then
  33.   mkdir doc
  34.   echo "mkdir doc"
  35. fi
  36. echo "extracting doc/rcs.ms"
  37. sed 's/^X//' << \SHAR_EOF > doc/rcs.ms
  38. X.\    Format this file with:
  39. X.\    pic file | tbl | troff -ms 
  40. X
  41. X.\ PS and PE center pic diagrams. (The corresponding ms-macros may not.)
  42. X.de PS
  43. X.nr pE (\\n(.lu-\\$2u)/2u
  44. X.in +\\n(pEu
  45. X.ne \\$1u
  46. X..
  47. X.de PE
  48. X.in -\\n(pEu
  49. X..
  50. X.de D(
  51. X.DS
  52. X.nr VS 12pts
  53. X.vs 12pts
  54. X.I
  55. X..
  56. X.de D)
  57. X.DE
  58. X.nr VS 18pts
  59. X.vs 18pts
  60. X.R
  61. X..
  62. X
  63. X.ND July 1985
  64. X.RP
  65. X.TL
  66. XRCS \- A System for Version Control
  67. X
  68. X.AU
  69. XWalter F. Tichy
  70. X.AI
  71. XDepartment of Computer Sciences
  72. XPurdue University
  73. XWest Lafayette, Indiana 47907
  74. X
  75. X.AB
  76. XAn important problem in program development and maintenance is version control,
  77. Xi.e., the task of keeping a software system consisting of many versions and
  78. Xconfigurations well organized.
  79. XThe Revision Control System (RCS) 
  80. Xis a software tool that assists with that task.
  81. XRCS manages revisions of text documents, in particular source programs,
  82. Xdocumentation, and test data.
  83. XIt automates the storing, retrieval, logging and identification of revisions,
  84. Xand it provides selection mechanisms for composing configurations.
  85. XThis paper introduces basic version control concepts and
  86. Xdiscusses the practice of version control
  87. Xusing RCS.
  88. XFor conserving space, RCS stores deltas, i.e., differences between
  89. Xsuccessive revisions. Several delta storage methods are discusses.
  90. XUsage statistics show that RCS's delta storage method is
  91. Xspace and time efficient.
  92. XThe paper concludes with a detailed survey of version control tools.
  93. X
  94. X\fBKeywords\fR: configuration management, history management,
  95. Xversion control, revisions, deltas.
  96. X.AE
  97. X.FS
  98. XA version of this paper was published in Software--Practice and Experience,
  99. XVol. 15(7), 637-654 (July 1985).
  100. X.FE
  101. X.nr VS 18pts
  102. X.EQ
  103. Xdelim $$
  104. X.EN
  105. X.LP
  106. X.NH
  107. XIntroduction
  108. X.PP
  109. XVersion control is the task of keeping software
  110. Xsystems consisting of many versions and configurations well organized.
  111. XThe Revision Control System (RCS) is a set of UNIX 
  112. Xcommands that assist with that task.
  113. X.PP
  114. XRCS' primary function is to manage \fIrevision groups\fR.
  115. XA revision group is a set of text documents, called \fIrevisions\fR,
  116. Xthat evolved from each other. A new revision is
  117. Xcreated by manually editing an existing one.
  118. XRCS organizes the revisions into an ancestral tree. The initial revision
  119. Xis the root of the tree, and the tree edges indicate
  120. Xfrom which revision a given one evolved.
  121. XBesides managing individual revision groups, RCS provides
  122. Xflexible selection functions for composing configurations.
  123. XRCS may be combined with MAKE\u1\d,
  124. Xresulting in a powerful package for version control.
  125. X.PP
  126. XRCS also offers facilities for
  127. Xmerging updates with customer modifications,
  128. Xfor distributed software development, and
  129. Xfor automatic identification.
  130. XIdentification is the `stamping'
  131. Xof revisions and configurations with unique markers.
  132. XThese markers are akin to serial numbers,
  133. Xtelling software maintainers unambiguously which configuration
  134. Xis before them.
  135. X.PP
  136. XRCS is designed for both production and experimental
  137. Xenvironments.
  138. XIn production environments,
  139. Xaccess controls detect update conflicts and prevent overlapping changes.
  140. XIn experimental environments, where strong controls are
  141. Xcounterproductive, it is possible to loosen the controls.
  142. X.PP
  143. XAlthough RCS was originally intended for programs, it is useful for any
  144. Xtext that is revised frequently and whose previous revisions must be
  145. Xpreserved. RCS has been applied successfully to store the source
  146. Xtext for drawings, VLSI layouts, documentation, specifications,
  147. Xtest data, form letters and articles.
  148. X.PP
  149. XThis paper discusses the practice of
  150. Xversion control using RCS.
  151. XIt also introduces basic version control concepts,
  152. Xuseful for clarifying current practice and designing similar systems.
  153. XRevision groups of individual components are treated in the next three sections,
  154. Xand the extensions to configurations follow.
  155. XBecause of its size, a survey of version control tools
  156. Xappears at the end of the paper.
  157. X.NH
  158. XGetting started with RCS
  159. X.PP
  160. XSuppose a text file \fIf.c\fR is to be placed under control of RCS.
  161. XInvoking the check-in command
  162. X.D(
  163. Xci  f.c
  164. X.D)
  165. Xcreates a new revision group with the contents of
  166. X\fIf.c\fR as the initial
  167. Xrevision (numbered 1.1)
  168. Xand stores the group into the file \fIf.c,v\fR.
  169. XUnless told otherwise, the command deletes \fIf.c\fR.
  170. XIt also asks for a description of the group.
  171. XThe description should state the common purpose of all revisions in the group,
  172. Xand becomes part of the group's documentation.
  173. XAll later check-in commands will ask for a log entry,
  174. Xwhich should summarize the changes made.
  175. X(The first revision is assigned a default log message,
  176. Xwhich just records the fact that it is the initial revision.)
  177. X.PP
  178. XFiles ending in \fI,v\fR
  179. Xare called \fIRCS files\fR (\fIv\fR stands for \fIv\fRersions);
  180. Xthe others are called working files.
  181. XTo get back the working file \fIf.c\fR in the previous example,
  182. Xexecute the check-out command:
  183. X.D(
  184. Xco  f.c
  185. X.D)
  186. X.R
  187. XThis command extracts the latest revision from
  188. Xthe revision group \fIf.c,v\fR and writes
  189. Xit into \fIf.c\fR.
  190. XThe file \fIf.c\fR can now be edited and, when finished,
  191. Xchecked back in with \fIci\fR:
  192. X.D(
  193. Xci  f.c
  194. X.D)
  195. X\fICi\fR assigns number 1.2 to
  196. Xthe new revision.
  197. XIf \fIci\fR complains with the message
  198. X.D(
  199. Xci error: no lock set by <login>
  200. X.D)
  201. Xthen the system administrator has decided to configure RCS for a
  202. Xproduction environment by enabling the `strict locking feature'.
  203. XIf this feature is enabled, all RCS files are initialized
  204. Xsuch that check-in operations require a lock on the previous revision
  205. X(the one from which the current one evolved).
  206. XLocking prevents overlapping modifications if several people work on the same file.
  207. XIf locking is required, the revision should
  208. Xhave been locked during the check-out by using
  209. Xthe option \fI-l\fR:
  210. X.D(
  211. Xco  -l  f.c
  212. X.D)
  213. XOf course it is too late now for the check-out with locking, because
  214. X\fIf.c\fR has already been changed; checking out the file again
  215. Xwould overwrite the modifications.
  216. X(To prevent accidental overwrites, \fIco\fR senses the presence
  217. Xof a working file and asks whether the user really intended to overwrite it.
  218. XThe overwriting check-out is sometimes useful for
  219. Xbacking up to the previous revision.)
  220. XTo be able to proceed with the check-in in the present case, first execute
  221. X.D(
  222. Xrcs  -l  f.c
  223. X.D)
  224. XThis command retroactively locks the latest revision, unless someone
  225. Xelse locked it in the meantime. In this case, the two programmers
  226. Xinvolved have to negotiate whose
  227. Xmodifications should take precedence.
  228. X.PP
  229. XIf an RCS file is private, i.e., if only the owner of the file is expected
  230. Xto deposit revisions into it, the strict locking feature is unnecessary and
  231. Xmay be disabled.
  232. XIf strict locking is disabled,
  233. Xthe owner of the RCS file need not have a lock for check-in.
  234. XFor safety reasons, all others
  235. Xstill do. Turning strict locking off and on is done with the commands:
  236. X.D(
  237. Xrcs  -U  f.c       \fRand\fI         rcs  -L  f.c
  238. X.D)
  239. XThese commands enable or disable the strict locking feature for each RCS file
  240. Xindividually.
  241. XThe system administrator only decides whether strict locking is
  242. Xenabled initially.
  243. X.PP
  244. XTo reduce the clutter in a working directory, all RCS files can be moved
  245. Xto a subdirectory with the name \fIRCS\fR.
  246. XRCS commands look first into that directory for RCS files.
  247. XAll the commands presented above work
  248. Xwith the \fIRCS\fR subdirectory without change.\(dg
  249. X.FS
  250. X\(dg Pairs of RCS and working files can actually be specified in 3 ways:
  251. Xa) both are given, b) only the working file is given, c) only the
  252. XRCS file is given.
  253. XIf a pair is given, both files may have arbitrary path prefixes;
  254. XRCS commands pair them up intelligently.
  255. X.FE
  256. X.PP
  257. XIt may be undesirable that \fIci\fR deletes the working file.
  258. XFor instance, sometimes one would like to save the current revision,
  259. Xbut continue editing.
  260. XInvoking
  261. X.D(
  262. Xci  -l  f.c
  263. X.D)
  264. Xchecks in \fIf.c\fR as usual, but performs an additional
  265. Xcheck-out with locking afterwards. Thus, the working file does
  266. Xnot disappear after the check-in.
  267. XSimilarly, the option
  268. X\fI-u\fR does a check-in followed by a check-out without
  269. Xlocking. This option is useful if the file is needed for compilation after the check-in.
  270. XBoth options update the identification markers in the working file
  271. X(see below).
  272. X.PP
  273. XBesides the operations \fIci\fR and \fIco\fR, RCS provides the following
  274. Xcommands:
  275. X\fIident\fR (extract identification markers),
  276. X\fIrcs\fR (change RCS file attributes),
  277. X\fIrcsclean\fR (remove unchanged working files),
  278. X\fIrcsdiff\fR (compare revisions),
  279. X\fIrcsfreeze\fR (record a configuration),
  280. X\fIrcsmerge\fR (merge revisions),
  281. Xand \fIrlog\fR (read log messages and other information in RCS files).
  282. XA synopsis of these commands appears in the Appendix.
  283. X.NH 2
  284. XAutomatic Identification
  285. X.PP
  286. XRCS can stamp source and object code with special identification strings,
  287. Xsimilar to product and serial numbers.
  288. XTo obtain such identification, place the marker
  289. X.D(
  290. X$Header$
  291. X.D)
  292. Xinto the text of a revision, for instance inside a comment.
  293. XThe check-out operation will replace this marker with a string of the form
  294. X.D(
  295. X$Header:  filename  revisionnumber  date  time  author  state  locker $
  296. X.D)
  297. XThis string need never be touched, because \fIco\fR keeps it
  298. Xup to date automatically.
  299. XTo propagate the marker into object code, simply put
  300. Xit into a literal character string. In C, this is done as follows:
  301. X.D(
  302. Xstatic char rcsid[] = "$Header$";
  303. X.D)
  304. XThe command \fIident\fR extracts such markers from any file, in particular from
  305. Xobject code.
  306. X\fIIdent\fR helps to find out
  307. Xwhich revisions of which modules were used in a given program.
  308. XIt returns a complete and unambiguous component list,
  309. Xfrom which a copy of the program can be reconstructed.
  310. XThis facility is invaluable for program maintenance.
  311. X.PP
  312. XThere are several additional identification markers, one for each component
  313. Xof $Header$.
  314. XThe marker
  315. X.D(
  316. X$Log$
  317. X.D)
  318. Xhas a similar function. It accumulates
  319. Xthe log messages that are requested during check-in.
  320. XThus, one can maintain the complete history of a revision directly inside it,
  321. Xby enclosing it in a comment.
  322. XFigure 1 is a partial reproduction of a log contained in revision 4.1 of
  323. Xthe file \fIci.c\fR. The log appears at the beginning of the file,
  324. Xand makes it easy to determine what the recent modifications were.
  325. X.sp
  326. X.nr VS 12pts
  327. X.vs 12pts
  328. X.ne 18
  329. X.nf
  330. X.in +0.5i
  331. X/* $Log:        ci.c,v $
  332. X * Revision 4.1  83/05/10  17:03:06  wft
  333. X * Added option -d and -w, and updated assignment of date, etc. to new delta.
  334. X * Added handling of default branches.
  335. X * 
  336. X * Revision 3.9  83/02/15  15:25:44  wft
  337. X * Added call to fastcopy() to copy remainder of RCS file.
  338. X *
  339. X * Revision 3.8  83/01/14  15:34:05  wft
  340. X * Added ignoring of interrupts while new RCS file is renamed;
  341. X * avoids deletion of RCS files by interrupts.
  342. X *
  343. X * Revision 3.7  82/12/10  16:09:20  wft
  344. X * Corrected checking of return code from diff.
  345. X * An RCS file now inherits its mode during the first ci from the working file,
  346. X * except that write permission is removed.
  347. X */
  348. X.in 0
  349. X.ce 1
  350. XFigure 1. Log entries produced by the marker $Log$.
  351. X.fi
  352. X.nr VS 18pts
  353. X.vs 18pts
  354. X.sp 0
  355. X.LP
  356. XSince revisions are stored in the form of differences,
  357. Xeach log message is
  358. Xphysically stored once,
  359. Xindependent of the number of revisions present.
  360. XThus, the $Log$ marker incurs negligible space overhead.
  361. X.NH
  362. XThe RCS Revision Tree
  363. X.PP
  364. XRCS arranges revisions in an ancestral tree.
  365. XThe \fIci\fR command builds this tree; the auxiliary command \fIrcs\fR
  366. Xprunes it.
  367. XThe tree has a root revision, normally numbered 1.1, and successive revisions
  368. Xare numbered 1.2, 1.3, etc. The first field of a revision number
  369. Xis called the \fIrelease number\fR and the second one
  370. Xthe \fIlevel number\fR. Unless given explicitly,
  371. Xthe \fIci\fR command assigns a new revision number
  372. Xby incrementing the level number of the previous revision.
  373. XThe release number must be incremented explicitly, using the
  374. X\fI-r\fR option of \fIci\fR.
  375. XAssuming there are revisions 1.1, 1.2, and 1.3 in the RCS file f.c,v, the command
  376. X.D(
  377. Xci  -r2.1  f.c       \fRor\fI       ci  -r2  f.c
  378. X.D)
  379. Xassigns the number 2.1 to the new revision.
  380. XLater check-ins without the \fI-r\fR option will assign the numbers 2.2, 2.3,
  381. Xand so on.
  382. XThe release number should be incremented only at major transition points
  383. Xin the development, for instance when a new release of a software product has
  384. Xbeen completed.
  385. X.NH 2
  386. XWhen are branches needed?
  387. X.PP
  388. XA young revision tree is slender:
  389. XIt consists of only one branch, called the trunk.
  390. XAs the tree ages, side branches may form.
  391. XBranches are needed in the following 4 situations.
  392. X.IP "\fITemporary fixes\fR"
  393. X.sp 0
  394. XSuppose a tree has 5 revisions grouped in 2 releases,
  395. Xas illustrated in Figure 2.
  396. XRevision 1.3, the last one of release 1, is in operation at customer sites,
  397. Xwhile release 2 is in active development.
  398. X.ne 4
  399. X.PS 4i
  400. X.ps -2
  401. Xbox "1.1"
  402. Xarrow
  403. Xbox "1.2"
  404. Xarrow
  405. Xbox "1.3"
  406. Xarrow
  407. Xbox "2.1"
  408. Xarrow
  409. Xbox "2.2"
  410. Xarrow dashed
  411. X.ps +2
  412. X.PE
  413. X.ce 1
  414. XFigure 2. A slender revision tree.
  415. X.sp 0
  416. XNow imagine a customer requesting a fix of
  417. Xa problem in revision 1.3, although actual development has moved on
  418. Xto release 2. RCS does not permit an extra
  419. Xrevision to be spliced in between 1.3 and 2.1, since that would not reflect
  420. Xthe actual development history. Instead, create a branch
  421. Xat revision 1.3, and check in the fix on that branch.
  422. XThe first branch starting at 1.3 has number 1.3.1, and
  423. Xthe revisions on that branch are numbered 1.3.1.1, 1.3.1.2, etc.
  424. XThe double numbering is needed to allow for another
  425. Xbranch at 1.3, say 1.3.2.
  426. XRevisions on the second branch would be numbered
  427. X1.3.2.1, 1.3.2.2, and so on.
  428. XThe following steps create
  429. Xbranch 1.3.1 and add revision 1.3.1.1:
  430. X.sp 0
  431. X.I
  432. X.nr VS 12pts
  433. X.vs 12pts
  434. X.TS
  435. Xtab(%);
  436. Xl l l.
  437. X     %co  -r1.3  f.c         % -- check out revision 1.3
  438. X     %edit  f.c              % -- change it
  439. X     %ci  -r1.3.1  f.c       % -- check it in on branch 1.3.1
  440. X.TE
  441. X.nr VS 18pts
  442. X.vs 18pts
  443. X.R
  444. XThis sequence of commands transforms the tree of Figure 2 into
  445. Xthe one in Figure 3.
  446. XNote that it may be necessary to incorporate the differences
  447. Xbetween 1.3 and 1.3.1.1
  448. Xinto a revision at level 2. The operation \fIrcsmerge\fR automates this
  449. Xprocess (see the Appendix).
  450. X.ne 7
  451. X.PS  4i
  452. X.ps -2
  453. X     box "1.1"
  454. X     arrow
  455. X     box "1.2"
  456. X     arrow
  457. XR13: box "1.3"
  458. X     arrow
  459. XR21: box "2.1"
  460. X     arrow
  461. XR22: box "2.2"
  462. X     arrow dashed
  463. X     line invis down from R21.s
  464. XRB1: box "1.3.1.1"
  465. X     arrow dashed right from RB1.e
  466. X     arrow from R13.s to RB1.w
  467. X.ps +2
  468. X.PE
  469. X.ce 1
  470. XFigure 3. A revision tree with one side branch
  471. X
  472. X.IP "\fIDistributed development and customer modifications\fR"
  473. X.sp 0
  474. XAssume a situation as in Figure 2, where revision 1.3 is in operation
  475. Xat several customer sites,
  476. Xwhile release 2 is in development.
  477. XCustomer sites should use RCS to store the distributed software.
  478. XHowever, customer modifications should not be placed on the same branch
  479. Xas the distributed source; instead, they should be placed on a side branch.
  480. XWhen the next software distribution arrives,
  481. Xit should be appended to the trunk of
  482. Xthe customer's RCS file, and the customer
  483. Xcan then merge the local modifications back into the new release.
  484. XIn the above example, a
  485. Xcustomer's RCS file would contain the following tree, assuming
  486. Xthat the customer has received revision 1.3, added his local modifications
  487. Xas revision 1.3.1.1, then received revision 2.4, and merged
  488. X2.4 and 1.3.1.1, resulting in 2.4.1.1.
  489. X.ne 7
  490. X.PS  4i
  491. X.ps -2
  492. XR13: box "1.3"
  493. X     line invis
  494. XR21: box invis
  495. X     line invis
  496. XR22: box invis
  497. X     line invis
  498. XR24: box "2.4"
  499. X     line invis
  500. XR25: box invis
  501. X     line invis
  502. X     arrow from R13.e to R24.w
  503. X     line invis down from R21.s
  504. XRB1: box "1.3.1.1"
  505. X     arrow from R13.s to RB1.w
  506. X     right
  507. X     line invis down from R25.s
  508. XRB2: box "2.4.1.1"
  509. X     arrow from R24.s to RB2.w
  510. X.ps +2
  511. X.PE
  512. X.ce 1
  513. XFigure 4. A customer's revision tree with local modifications.
  514. X.sp 1
  515. XThis approach is actually practiced in the CSNET project,
  516. Xwhere several universities and a company cooperate
  517. Xin developing a national computer network.
  518. X.IP "\fIParallel development\fR"
  519. X.sp 0
  520. XSometimes it is desirable to explore an alternate design or
  521. Xa different implementation technique in parallel with the
  522. Xmain line development. Such development
  523. Xshould be carried out on a side branch.
  524. XThe experimental changes may later be moved into the main line, or abandoned.
  525. X.IP "\fIConflicting updates\fR"
  526. X.sp 0
  527. XA common occurrence is that one programmer
  528. Xhas checked out a revision, but cannot complete the assignment
  529. Xfor some reason. In the meantime, another person
  530. Xmust perform another modification
  531. Ximmediately. In that case, the second person should check-out the same revision,
  532. Xmodify it, and check it in on a side branch, for later merging.
  533. X.PP
  534. XEvery node in a revision tree consists of the following attributes:
  535. Xa revision number, a check-in date and time, the author's identification,
  536. Xa log entry, a state and the actual text. All these attributes
  537. Xare determined at the time the revision is checked in.
  538. XThe state attribute indicates the status of a revision.
  539. XIt is set automatically to `experimental' during check-in.
  540. XA revision can later be promoted to a higher status, for example
  541. X`stable' or `released'. The set of states is user-defined.
  542. X.NH 2
  543. XRevisions are represented as deltas
  544. X.PP
  545. XFor conserving space, RCS stores revisions in the form
  546. Xof deltas, i.e., as differences between revisions.
  547. XThe user interface completely hides this fact.
  548. X.PP
  549. XA delta is a sequence of edit commands that transforms one string
  550. Xinto another. The deltas employed by RCS are line-based, which means
  551. Xthat the only edit commands allowed are insertion and deletion of lines.
  552. XIf a single character in a line is changed, the
  553. Xedit scripts consider the entire line changed.
  554. XThe program \fIdiff\fR\u2\d
  555. Xproduces a small, line-based delta between pairs of text files.
  556. XA character-based edit script would take much longer to compute,
  557. Xand would not be significantly shorter.
  558. X.PP
  559. XUsing deltas is a classical space-time tradeoff: deltas reduce the
  560. Xspace consumed, but increase access time.
  561. XHowever, a version control tool should impose as little delay
  562. Xas possible on programmers.
  563. XExcessive delays discourage the use of version controls,
  564. Xor induce programmers to take shortcuts that compromise system integrity.
  565. XTo gain reasonably fast access time for both editing and compiling,
  566. XRCS arranges deltas in the following way.
  567. XThe most recent revision on the trunk is stored intact.
  568. XAll other revisions on the trunk are stored as reverse deltas.
  569. XA reverse delta describes how to go backward in the development history:
  570. Xit produces the desired revision if applied to the successor of that revision.
  571. XThis implementation has the advantage
  572. Xthat extraction of the latest revision is a simple and fast copy
  573. Xoperation.
  574. XAdding a new revision to the trunk is also fast: \fIci\fR simply
  575. Xadds the new revision intact, replaces the previous
  576. Xrevision with a reverse delta, and keeps the rest of the old deltas.
  577. XThus, \fIci\fR requires the computation
  578. Xof only one new delta.
  579. X.PP
  580. XBranches need special treatment. The naive solution would be to
  581. Xstore complete copies for the tips of all branches.
  582. XClearly, this approach would cost too much space. Instead,
  583. XRCS uses \fIforward\fR deltas for branches. Regenerating a revision
  584. Xon a side branch proceeds as follows. First, extract the latest revision
  585. Xon the trunk; secondly, apply reverse deltas until the fork revision for
  586. Xthe branch is obtained; thirdly, apply forward deltas until the desired
  587. Xbranch revision is reached. Figure 5 illustrates a tree with
  588. Xone side branch. Triangles pointing to the left and right represent
  589. Xreverse and forward deltas, respectively.
  590. X.ne 8
  591. X.PS  4i
  592. X.ps -2
  593. Xdefine BD X [line invis $1 right .5;
  594. Xline up .3 then left .5 down .3 then right .5 down .3 then up .3] X
  595. X
  596. Xdefine FD X [line invis $1 right .5;
  597. Xline left .5 down .3 then up .6 then right .5 down .3;] X
  598. X
  599. Xright
  600. XD11:    BD(" 1.1")
  601. X    arrow right from D11.e
  602. XD12:    BD(" 1.2")
  603. X    arrow  right from D12.e
  604. XD13:    BD(" 1.3")
  605. X    arrow  right from D13.e
  606. XD21:    BD(" 2.1")
  607. X    arrow  right from D21.e
  608. XD22:    box "2.2"
  609. X    line invis down from D21.s
  610. XF1:     FD("1.3.1.1 ")
  611. X    arrow from D13.se to F1.w
  612. X    arrow from F1.e right
  613. X    right
  614. XF2:     FD("1.3.1.2 ")
  615. X.ps +2
  616. X.PE
  617. X.ce 1
  618. XFigure 5. A revision tree with reverse and forward deltas.
  619. X.sp 0
  620. X.PP
  621. XAlthough implementing fast check-out for the latest trunk revision, 
  622. Xthis arrangement has the disadvantage that generation of other revisions 
  623. Xtakes time proportional to the number of deltas applied. For example, 
  624. Xregenerating the branch tip in Figure 5 requires application of five 
  625. Xdeltas (including the initial one). Since usage statistics show that
  626. Xthe latest trunk revision is the one that is retrieved in 95 per cent 
  627. Xof all cases (see the section on usage statistics), biasing check-out time 
  628. Xin favor of that revision results in significant savings.
  629. XHowever, careful implementation of the delta application process is
  630. Xnecessary to provide low retrieval overhead for other revisions, in
  631. Xparticular for branch tips.
  632. X.PP
  633. XThere are several techniques for delta application.
  634. XThe naive one is to pass each delta to a general-purpose text editor.
  635. XA prototype of RCS invoked the UNIX editor \fIed\fR both
  636. Xfor applying deltas and for expanding the identification markers.
  637. XAlthough easy to implement, performance was poor, owing to the 
  638. Xhigh start-up costs and excess generality of \fIed\fR. An intermediate
  639. Xversion of RCS used a special-purpose, stream-oriented editor.
  640. XThis technique reduced the cost of applying a delta to the cost of
  641. Xchecking out the latest trunk revision. The reason for this behavior
  642. Xis that each delta application involves a complete pass over
  643. Xthe preceding revision.
  644. X.PP
  645. XHowever, there is a much better algorithm. Note that the deltas are
  646. Xline oriented and that most of the work of a stream editor involves
  647. Xcopying unchanged lines from one revision to the next. A faster
  648. Xalgorithm avoids unnecessary copying of character strings by using
  649. Xa \fIpiece table\fR. 
  650. XA piece table is a one-dimensional array, specifying how a given
  651. Xrevision is `pieced together' from lines in the RCS file.
  652. XSuppose piece table \fIPT\dr\u\fR represents revision \fIr\fR.
  653. XThen \fIPT\dr\u[i]\fR contains the starting position of line \fIi\fR
  654. Xof revision \fIr\fR.
  655. XApplication of the next delta transforms piece table \fIPT\dr\u\fR
  656. Xinto \fIPT\dr+1\u\fR. For instance, a delete command removes a
  657. Xseries of entries from the piece table. An insertion command inserts
  658. Xnew entries, moving the entries following the insertion point further down the
  659. Xarray. The inserted entries point to the text lines in the delta.
  660. XThus, no I/O is involved except for reading the delta itself. When all
  661. Xdeltas have been applied to the piece table, a sequential pass
  662. Xthrough the table looks up each line in the RCS file and copies it to
  663. Xthe output file, updating identification markers at the same time.
  664. XOf course, the RCS file must permit random access, since the copied
  665. Xlines are scattered throughout that file. Figure 6 illustrates an
  666. XRCS file with two revisions and the corresponding piece tables.
  667. X.ne 13
  668. X.sp 12
  669. X.ce 1
  670. XFigure 6. An RCS file and its piece tables
  671. X.sp 0
  672. X.PP
  673. XThe piece table approach has the property that the time for applying a single
  674. Xdelta is roughly determined by the size of the delta, and not by the
  675. Xsize of the revision. For example, if a delta is 
  676. X10 per cent of the size of a revision, then applying it takes only 
  677. X10 per cent of the time to generate the latest trunk revision. (The stream
  678. Xeditor would take 100 per cent.)
  679. X.PP
  680. XThere is an important alternative for representing deltas that affects
  681. Xperformance. SCCS\u3\d,
  682. Xa precursor of RCS, uses \fIinterleaved\fR deltas.
  683. XA file containing interleaved deltas is partitioned into blocks of lines.
  684. XEach block has a header that specifies to which revision(s) the block
  685. Xbelongs. The blocks are sorted out in such a way that a single
  686. Xpass over the file can pick up all the lines belonging to a given
  687. Xrevision. Thus, the regeneration time for all revisions is the same:
  688. Xall headers must be inspected, and the associated blocks either copied
  689. Xor skipped. As the number of revisions increases, the cost of retrieving
  690. Xany revision is much higher than the cost of checking out the 
  691. Xlatest trunk revision with reverse deltas. A detailed comparison
  692. Xof SCCS's interleaved deltas and RCS's reverse deltas can be found
  693. Xin Reference 4.
  694. XThis reference considers the version of RCS with the
  695. Xstream editor only. The piece table method improves performance
  696. Xfurther, so that RCS is always faster than SCCS, except if 10
  697. Xor more deltas are applied.
  698. X.PP
  699. XAdditional speed-up for both delta methods can be obtained by caching
  700. Xthe most recently generated revision, as has been implemented in DSEE.\u5\d
  701. XWith caching, access time to frequently used revisions can approach normal file
  702. Xaccess time, at the cost of some additional space.
  703. X.NH
  704. XLocking: A Controversial Issue
  705. X.PP
  706. XThe locking mechanism for RCS was difficult to design.
  707. XThe problem and its solution are first presented in their `pure' form,
  708. Xfollowed by a discussion of the complications
  709. Xcaused by `real-world' considerations.
  710. X.PP
  711. XRCS must prevent two or more persons from depositing competing changes of the
  712. Xsame revision.
  713. XSuppose two programmers check out revision 2.4 and
  714. Xmodify it. Programmer A checks in a revision before programmer B.
  715. XUnfortunately, programmer B has not seen A's
  716. Xchanges, so the effect is that A's changes are covered up by B's deposit.
  717. XA's changes are not lost since all revisions
  718. Xare saved, but they are confined to a single revision\(dd.
  719. X.FS
  720. X\(dd Note that this problem is entirely different from the atomicity problem.
  721. XAtomicity means that
  722. Xconcurrent update operations on the same RCS file cannot be permitted,
  723. Xbecause that may result in inconsistent data.
  724. XAtomic updates are essential (and implemented in RCS),
  725. Xbut do not solve the conflict discussed here.
  726. X.FE
  727. X.PP
  728. XThis conflict is prevented in RCS by locking.
  729. XWhenever someone intends to edit a revision (as opposed
  730. Xto reading or compiling it), the revision should be checked out
  731. Xand locked,
  732. Xusing the \fI-l\fR option on \fIco\fR. On subsequent check-in,
  733. X\fIci\fR tests the lock and then removes it.
  734. XAt most one programmer at a time may
  735. Xlock a particular revision, and only this programmer may check in
  736. Xthe succeeding revision.
  737. XThus, while a revision is locked, it is the exclusive responsibility
  738. Xof the locker.
  739. X.PP
  740. XAn important maxim for software tools like RCS is that they must
  741. Xnot stand in the way of making progress with a project.
  742. XThis consideration leads to several weakenings of the locking mechanism.
  743. XFirst of all, even if a revision is locked, it can
  744. Xstill be checked out. This is necessary if other people
  745. Xwish to compile or inspect the locked revision
  746. Xwhile the next one is in preparation. The only operations they
  747. Xcannot do are to lock the revision or to check in the succeeding one. Secondly,
  748. Xcheck-in operations on other branches in the RCS file are still possible; the
  749. Xlocking of one revision does not affect any other revision.
  750. XThirdly, revisions are occasionally locked for a long period of time
  751. Xbecause a programmer is absent or otherwise unable to complete
  752. Xthe assignment. If another programmer has to make a pressing change,
  753. Xthere are the following three alternatives for making progress:
  754. Xa) find out who is holding the lock and ask that person to release it;
  755. Xb) check out the locked revision, modify it, check it
  756. Xin on a branch, and merge the changes later;
  757. Xc) break the lock. Breaking a lock leaves a highly visible
  758. Xtrace, namely an electronic mail message that is sent automatically to the
  759. Xholder of the lock, recording the breaker and a commentary requested from him.
  760. XThus, breaking locks is tolerated under certain circumstances,
  761. Xbut will not go unnoticed.
  762. XExperience has shown that the automatic mail message attaches a high enough
  763. Xstigma to lock breaking,
  764. Xsuch that programmers break locks only in real emergencies,
  765. Xor when a co-worker resigns and leaves locked revisions behind.
  766. X.PP
  767. XIf an RCS file is private, i.e., when a programmer owns an RCS file
  768. Xand does not expect anyone else to perform check-in operations,
  769. Xlocking is an unnecessary nuisance.
  770. XIn this case,
  771. Xthe `strict locking feature' discussed earlier may be disabled,
  772. Xprovided that file protection
  773. Xis set such that only the owner may write the RCS file.
  774. XThis has the effect that only the owner can check-in revisions,
  775. Xand that no lock is needed for doing so.
  776. X.PP
  777. XAs added protection,
  778. Xeach RCS file contains an access list that specifies the users
  779. Xwho may execute update operations. If an access list is empty,
  780. Xonly normal UNIX file protection applies. Thus, the access list is
  781. Xuseful for restricting the set of people who would otherwise have update
  782. Xpermission. Just as with locking, the access list
  783. Xhas no effect on read-only operations such as \fIco\fR. This approach
  784. Xis consistent with the UNIX philosophy of openness, which contributes
  785. Xto a productive software development environment.
  786. X.NH
  787. XConfiguration Management
  788. X.PP
  789. XThe preceding sections described how RCS deals with revisions of individual
  790. Xcomponents; this section discusses how to handle configurations.
  791. XA configuration is a set of revisions, where each revision comes
  792. Xfrom a different revision group, and the revisions are selected
  793. Xaccording to a certain criterion.
  794. XFor example,
  795. Xin order to build a functioning compiler, the `right'
  796. Xrevisions from the scanner, the parser, the optimizer
  797. Xand the code generator must be combined.
  798. XRCS, in conjunction with MAKE,
  799. Xprovides a number of facilities to effect a smooth selection.
  800. X.NH 2
  801. XRCS Selection Functions
  802. X.PP
  803. X.IP "\fIDefault selection\fR"
  804. X.sp 0
  805. XDuring development, the usual selection criterion is to choose
  806. Xthe latest revision of all components. The \fIco\fR command
  807. Xmakes this selection by default. For example, the command
  808. X.D(
  809. Xco  *,v
  810. X.D)
  811. Xretrieves the latest revision on the default branch of each RCS file
  812. Xin the current directory.
  813. XThe default branch is usually the trunk, but may be
  814. Xset to be a side branch.
  815. XSide branches as defaults are needed in distributed software development,
  816. Xas discussed in the section on the RCS revision tree.
  817. X
  818. X.IP "\fIRelease based selection\fR"
  819. X.sp 0
  820. XSpecifying a release or branch number selects the latest revision in
  821. Xthat release or branch.
  822. XFor instance,
  823. X.D(
  824. Xco  -r2  *,v
  825. X.D)
  826. Xretrieves the latest revision with release number 2 from each RCS file.
  827. XThis selection is convenient if a release has been completed and
  828. Xdevelopment has moved on to the next release.
  829. X
  830. X.IP "\fIState and author based selection\fR"
  831. X.sp 0
  832. XIf the highest level number within a given release number 
  833. Xis not the desired one,
  834. Xthe state attribute can help. For example,
  835. X.D(
  836. Xco  -r2  -sReleased  *,v
  837. X.D)
  838. Xretrieves the latest revision with release number 2 whose state attribute
  839. Xis `Released'.
  840. XOf course, the state attribute has to be set appropriately, using the
  841. X\fIci\fR or \fIrcs\fR commands.
  842. XAnother alternative is to select a revision by its author,
  843. Xusing the \fI-w\fR option.
  844. X
  845. X.IP "\fIDate based selection\fR"
  846. X.sp 0
  847. XRevisions may also be selected by date.
  848. XSuppose a release of an entire system was
  849. Xcompleted and current on March 4, at 1:00 p.m. Then the command
  850. X.D(
  851. Xco  -d"March 4, 1:00 pm"  *,v
  852. X.D)
  853. Xchecks out all the components of that release, independent of the numbering.
  854. XThe \fI-d\fR option specifies a `cutoff date', i.e.,
  855. Xthe revision selected has a check-in date that
  856. Xis closest to, but not after the date given.
  857. X208z
  858. X.IP "\fIName based selection\fR"
  859. X.sp 0
  860. XThe most powerful selection function is based on assigning symbolic
  861. Xnames to revisions and branches.
  862. XIn large systems, a single release number or date is not sufficient
  863. Xto collect the appropriate revisions from all groups.
  864. XFor example, suppose one wishes to combine release 2
  865. Xof one subsystem and release 15 of another.
  866. XMost likely, the creation dates of those releases differ also.
  867. XThus, a single revision number or date passed to the \fIco\fR command
  868. Xwill not suffice to select the right revisions.
  869. XSymbolic revision numbers solve this problem.
  870. XEach RCS file may contain a set of symbolic names that are mapped
  871. Xto numeric revision numbers. For example, assume
  872. Xthe symbol \fIV3\fR is bound to release number 2 in file \fIs,v\fR, and to
  873. Xrevision number 15.9 in \fIt,v\fR.
  874. XThen the single command
  875. X.D(
  876. Xco  -rV3  s,v  t,v
  877. X.D)
  878. Xretrieves the latest revision of release 2 from \fIs,v\fR,
  879. Xand revision 15.9 from \fIt,v\fR.
  880. XIn a large system with many modules, checking out all
  881. Xrevisions with one command greatly simplifies configuration management.
  882. X.PP
  883. XJudicious use of symbolic revision numbers helps with organizing
  884. Xlarge configurations.
  885. XA special command, \fIrcsfreeze\fR,
  886. Xassigns a symbolic revision number to a selected revision
  887. Xin every RCS file.
  888. X\fIRcsfreeze\fR effectively freezes a configuration.
  889. XThe assigned symbolic revision number selects all components
  890. Xof the configuration.
  891. XIf necessary, symbolic numbers
  892. Xmay even be intermixed with numeric ones. Thus, \fIV3.5\fR in the
  893. Xabove example
  894. Xwould select revision 2.5 in \fIs,v\fR and branch 15.9.5 in \fIt,v\fR.
  895. X.PP
  896. XThe options \fI-r\fR, \fI-s\fR, \fI-w\fR and \fI-d\fR
  897. Xmay be combined. If a branch is given, the latest revision
  898. Xon that branch satisfying all conditions is retrieved;
  899. Xotherwise, the default branch is used.
  900. X.NH 2
  901. XCombining MAKE and RCS
  902. X.PP
  903. XMAKE\u1\d
  904. Xis a program that processes configurations.
  905. XIt is driven by configuration specifications
  906. Xrecorded in a special file, called a `Makefile'.
  907. XMAKE avoids redundant processing steps
  908. Xby comparing creation dates of source and processed objects.
  909. XFor example, when instructed to compile all
  910. Xmodules of a given system, it only recompiles
  911. Xthose source modules that were changed
  912. Xsince they were processed last.
  913. X.PP
  914. XMAKE has been extended with an auto-checkout feature for RCS.
  915. XWhen a certain file to be processed is not present,
  916. XMAKE attempts a check-out operation. 
  917. XIf successful, MAKE performs the required processing, and then deletes
  918. Xthe checked out file to conserve space.
  919. XThe selection parameters discussed above can be passed to MAKE
  920. Xeither as parameters, or directly embedded in the Makefile.
  921. XMAKE has also been extended to search the subdirectory named \fIRCS\fR
  922. Xfor needed files, rather than just the current working directory.
  923. XHowever, if a working file is present, MAKE totally ignores the corresponding
  924. XRCS file and uses the working file.
  925. X(In newer versions of MAKE distributed by AT&T and others, 
  926. Xauto-checkout can be
  927. Xachieved with the rule DEFAULT, instead of a special extension of MAKE.
  928. XHowever, a file checked out by the rule DEFAULT
  929. Xwill not be deleted after processing. \fIRcsclean\fR can be
  930. Xused for that purpose.)
  931. X.PP
  932. XWith auto-checkout, RCS/MAKE can effect a selection rule
  933. Xespecially tuned for multi-person software development and maintenance.
  934. XIn these situations,
  935. Xprogrammers should obtain configurations that consist of
  936. Xthe revisions they have personally checked out plus the latest
  937. Xchecked in revision of all other revision groups.
  938. XThis schema can be set up as follows.
  939. X.PP
  940. XEach programmer chooses a working directory
  941. Xand places into it a symbolic link, named \fIRCS\fR,
  942. Xto the directory containing the relevant RCS files.
  943. XThe symbolic link makes sure that \fIco\fR and \fIci\fR
  944. Xoperations need only specify the working files, and that
  945. Xthe Makefile need not be changed.
  946. XThe programmer then checks out the needed files and modifies them.
  947. XIf MAKE is invoked,
  948. Xit composes configurations by selecting those
  949. Xrevisions that are checked out, and the rest from the
  950. Xsubdirectory \fIRCS\fR.
  951. XThe latter selection may be controlled by a symbolic
  952. Xrevision number or any of the other selection criteria.
  953. XIf there are several programmers editing in separate working directories,
  954. Xthey are insulated from each other's changes until checking in their
  955. Xmodifications.
  956. X.PP
  957. XSimilarly, a maintainer can recreate an older configuration
  958. Xby starting to work in an empty working directory.
  959. XDuring the initial MAKE invocation, all revisions are selected from RCS files.
  960. XAs the maintainer checks out files and modifies them,
  961. Xa new configuration is gradually built up.
  962. XEvery time MAKE is invoked, it substitutes the modified revisions
  963. Xinto the configuration being manipulated.
  964. X.PP
  965. XA final application of RCS is to use it for storing Makefiles.
  966. XRevision groups of Makefiles represent
  967. Xmultiple versions of configurations.
  968. XWhenever a configuration is baselined or distributed,
  969. Xthe best approach is to unambiguously fix
  970. Xthe configuration with a symbolic revision number by calling
  971. X\fIrcsfreeze\fR,
  972. Xto embed that symbol into the Makefile, and to
  973. Xcheck in the Makefile (using the same symbolic revision number).
  974. XWith this approach, old configurations
  975. Xcan be regenerated easily and reliably.
  976. X.NH
  977. XUsage Statistics
  978. X.PP
  979. XThe following usage statistics were collected on two DEC VAX-11/780
  980. Xcomputers of the Purdue Computer Science Department. Both machines
  981. Xare mainly used for research purposes. Thus, the data
  982. Xreflect an environment in which the majority of projects
  983. Xinvolve prototyping and advanced software development,
  984. Xbut relatively little long-term maintenance.
  985. X.PP
  986. XFor the first experiment,
  987. Xthe \fIci\fR and \fIco\fR operations were instrumented
  988. Xto log the number of backward and forward deltas applied.
  989. XThe data were collected during a 13 month period
  990. Xfrom Dec. 1982 to Dec. 1983.
  991. XTable I summarizes the results.
  992. X.sp 0
  993. X.nr VS 12pts
  994. X.vs 12pts
  995. X.TS
  996. Xcenter,box,tab(#);
  997. Xc|c|c|c|c s|c s
  998. Xc|c|c|c|c s|c s
  999. Xl|n|n|n|n n|n n.
  1000. XOperation#Total#Total deltas#Mean deltas#Operations#Branch
  1001. X     #operations #applied#applied#with >1 delta#operations
  1002. X_
  1003. Xco     # 7867# 9320#1.18#509#(6%)#203#(3%)
  1004. Xci     # 3468# 2207#0.64# 85#(2%)# 75#(2%)
  1005. Xci & co#11335#11527#1.02#594#(5%)#278#(2%)
  1006. X.TE
  1007. X.ce 1
  1008. XTable I. Statistics for \fIco\fR and \fIci\fR operations.
  1009. X.nr VS 18pts
  1010. X.vs 18pts
  1011. X.PP
  1012. XThe first two lines show statistics for check-out and check-in;
  1013. Xthe third  line shows the combination.
  1014. XRecall that \fIci\fR performs an implicit check-out to obtain
  1015. Xa revision for computing the delta.
  1016. XIn all measures presented, the most recent revision (stored intact)
  1017. Xcounts as one delta. The number of deltas applied represents
  1018. Xthe number of passes necessary, where the first `pass' is a copying step.
  1019. X.PP
  1020. XNote that the check-out operation is executed more than
  1021. Xtwice as frequently as the check-in operation.
  1022. XThe fourth column gives the mean number of deltas
  1023. Xapplied in all three cases.
  1024. XFor \fIci\fR, the mean number of deltas applied is less
  1025. Xthan one.
  1026. XThe reasons are that the initial check-in requires no delta at all, and that
  1027. Xthe only time \fIci\fR requires more than one delta is for branches.
  1028. XColumn 5 shows the actual number of operations that applied more than one
  1029. Xdelta.
  1030. XThe last column indicates that branches were not used often.
  1031. X.PP
  1032. XThe last three columns demonstrate that the most recent trunk revision
  1033. Xis by far the most frequently accessed.
  1034. XFor RCS, check-out of
  1035. Xthis revision is a simple copy operation, which is the absolute minimum
  1036. Xgiven the copy-semantics of \fIco\fR.
  1037. XAccess to older revisions and branches
  1038. Xis more common in non-academic environments,
  1039. Xyet even if access to older deltas were an order
  1040. Xof magnitude more frequent,
  1041. Xthe combined average number of deltas applied would still be below 1.2.
  1042. XSince RCS is faster than SCCS until up to 10 delta applications,
  1043. Xreverse deltas are clearly the method of choice.
  1044. X.PP
  1045. XThe second experiment, conducted in March of 1984,
  1046. Xinvolved surveying the existing RCS files
  1047. Xon our two machines. The goal was to determine the mean number of
  1048. Xrevisions per RCS file, as well as the space consumed by them.
  1049. XTable II shows the results. (Tables I and II were produced at different
  1050. Xtimes and are unrelated.)
  1051. X.sp 0
  1052. X.nr VS 12pts
  1053. X.vs 12pts
  1054. X.TS
  1055. Xcenter,box,tab(#);
  1056. Xc | c | c | c | c | c | c
  1057. Xc | c | c | c | c | c | c
  1058. Xl | n | n | n | n | n | n
  1059. X.
  1060. X      #Total RCS#Total#Mean#Mean size of#Mean size of#Overhead
  1061. X      #files#revisions#revisions#RCS files#revisions
  1062. X_
  1063. XAll files #8033#11133#1.39#6156#5585#1.10
  1064. XFiles with#1477# 4578#3.10#8074#6041#1.34
  1065. X\(>= 2 deltas
  1066. X.TE
  1067. X.ce 1
  1068. XTable II. Statistics for RCS files.
  1069. X.nr VS 18pts
  1070. X.vs 18pts
  1071. X.PP
  1072. XThe mean number of revisions per RCS file is 1.39.
  1073. XColumns 5 and 6 show the mean sizes (in bytes) of an RCS file
  1074. Xand of the latest revision of each RCS file, respectively.
  1075. XThe `overhead' column contains the ratio of the mean sizes.
  1076. XAssuming that all revisions in an RCS file are approximately the same size,
  1077. Xthis ratio gives a measure of the space consumed by the extra revisions.
  1078. X.PP
  1079. XIn our sample, over 80 per cent of the RCS files contained only a single revision.
  1080. XThe reason is that our
  1081. Xsystems programmers routinely check in all source files
  1082. Xon the distribution tapes, even though they may never touch them again.
  1083. XTo get a better indication of how much space savings are possible
  1084. Xwith deltas, all measures with those files
  1085. Xthat contained 2 or more revisions were recomputed. Only for those files
  1086. Xis RCS necessary.
  1087. XAs shown in the second line, the average number of revisions for those files is
  1088. X3.10, with an overhead of 1.34. This means that the extra 2.10 deltas
  1089. Xrequire 34 per cent extra space, or
  1090. X16 per cent per extra revision.
  1091. XRochkind\u3\d
  1092. Xmeasured the space consumed by SCCS, and
  1093. Xreported an average of 5 revisions per group
  1094. Xand an overhead of 1.37 (or about 9 per cent per extra revision).
  1095. XIn a later paper, Glasser\u6\d
  1096. Xobserved an average of 7 revisions per group in a single, large project,
  1097. Xbut provided no overhead figure.
  1098. XIn his paper on DSEE\u5\d,
  1099. XLeblang reported that delta storage combined with blank compression
  1100. Xresults in an overhead of a mere 1\-2 per cent per revision.
  1101. XSince leading blanks accounted for about 20 per cent of the surveyed Pascal
  1102. Xprograms, a revision group with 5\-10 members was smaller
  1103. Xthan a single cleartext copy.
  1104. X.PP
  1105. XThe above observations demonstrate clearly that the space needed
  1106. Xfor extra revisions is small. With delta storage, the luxury of
  1107. Xkeeping multiple revisions online is certainly affordable.
  1108. XIn fact, introducing a system with delta storage may reduce
  1109. Xstorage requirements, because programmers often save back-up copies
  1110. Xanyway. Since back-up copies are stored much more efficiently with deltas,
  1111. Xintroducing a system such as RCS may
  1112. Xactually free a considerable amount of space.
  1113. X.NH
  1114. XSurvey of Version Control Tools
  1115. X.PP
  1116. XThe need to keep back-up copies of software arose when
  1117. Xprograms and data were no longer stored on paper media, but were entered
  1118. Xfrom terminals and stored on disk.
  1119. XBack-up copies are desirable for reliability, and many modern editors
  1120. Xautomatically save a back-up copy for every file touched.
  1121. XThis strategy
  1122. Xis valuable for short-term back-ups, but not suitable for long-term
  1123. Xversion control, since an existing back-up copy is overwritten whenever the
  1124. Xcorresponding file is edited.
  1125. X.PP
  1126. XTape archives are suitable for long-term, offline storage.
  1127. XIf all changed files are dumped on a back-up tape once per day, old revisions
  1128. Xremain accessible. However, tape archives are unsatisfactory
  1129. Xfor version control in several ways. First, backing up the file
  1130. Xsystem every 24 hours does not capture intermediate revisions.
  1131. XSecondly, the old revisions are not online,
  1132. Xand accessing them is tedious and time-consuming.
  1133. XIn particular, it is impractical to
  1134. Xcompare several old revisions of a group,
  1135. Xbecause that may require mounting and searching several tapes.
  1136. XTape archives are important fail-safe tools in the
  1137. Xevent of catastrophic disk failures or accidental deletions,
  1138. Xbut they are ill-suited for version control.
  1139. XConversely, version control tools do not obviate the
  1140. Xneed for tape archives.
  1141. X.PP
  1142. XA natural technique for keeping several old revisions online is
  1143. Xto never delete a file.
  1144. XEditing a file
  1145. Xsimply creates a new file with the same
  1146. Xname, but with a different sequence number.
  1147. XThis technique, available as an option in DEC's VMS operating system,
  1148. Xturns out to be inadequate for version control.
  1149. XFirst, it is prohibitively expensive in terms of storage costs,
  1150. Xespecially since no data compression techniques are employed.
  1151. XSecondly, indiscriminately storing every change produces too many
  1152. Xrevisions, and programmers have difficulties distinguishing them.
  1153. XThe proliferation of revisions forces programmers to spend much time on
  1154. Xfinding and deleting useless files.
  1155. XThirdly, most of the support functions like locking, logging,
  1156. Xrevision selection,
  1157. Xand identification described in this paper are not available.
  1158. X.PP
  1159. XAn alternative approach is to separate editing from revision control.
  1160. XThe user may repeatedly edit a given revision,
  1161. Xuntil freezing it with an explicit command.
  1162. XOnce a revision is frozen, it is stored permanently and can no longer be modified.
  1163. X(In RCS, freezing a revisions is done with \fIci\fR.)
  1164. XEditing a frozen revision implicitly creates a new one, which
  1165. Xcan again be changed repeatedly until it is frozen itself.
  1166. XThis approach saves exactly those revisions that the user
  1167. Xconsiders important, and keeps the number of revisions manageable.
  1168. XIBM's CLEAR/CASTER\u7\d,
  1169. XAT&T's SCCS\u3\d,
  1170. XCMU's SDC\u8\d
  1171. Xand DEC's CMS\u9\d,
  1172. Xare examples of version control systems using this approach.
  1173. XCLEAR/CASTER maintains a data base of programs, specifications,
  1174. Xdocumentation and messages, using deltas.
  1175. XIts goal is to provide control over the development process from a
  1176. Xmanagement viewpoint.
  1177. XSCCS stores multiple revisions of source text in an ancestral tree,
  1178. Xrecords a log entry for each revision,
  1179. Xprovides access control, and has facilities
  1180. Xfor uniquely identifying each revision.
  1181. XAn efficient delta technique
  1182. Xreduces the space consumed by each revision group.
  1183. XSDC is much simpler than SCCS because it stores not more than
  1184. Xtwo revisions. However, it maintains a complete log for all old
  1185. Xrevisions, some of which may be on back-up tape.
  1186. XCMS, like SCCS, manages tree-structured revision groups,
  1187. Xbut offers no identification mechanism.
  1188. X.PP
  1189. XTools for dealing with configurations are still in a state of flux.
  1190. XSCCS, SDC and CMS can be combined with MAKE or MAKE-like programs.
  1191. XSince flexible selection rules are missing from all these tools,
  1192. Xit is sometimes difficult
  1193. Xto specify precisely which revision of each group
  1194. Xshould be passed to MAKE for building a desired configuration.
  1195. XThe Xerox Cedar system\u10\d
  1196. Xprovides a `System Modeller' that can rebuild
  1197. Xa configuration from an arbitrary set of module revisions.
  1198. XThe revisions of a module are only distinguished by creation time,
  1199. Xand there is no tool for managing groups.
  1200. XSince the selection rules are primitive,
  1201. Xthe System Modeller appears to be somewhat tedious to use.
  1202. XApollo's DSEE\u5\d
  1203. Xis a sophisticated software engineering environment.
  1204. XIt manages revision groups in a way similar to SCCS and CMS. Configurations
  1205. Xare built using `configuration threads'.
  1206. XA configuration thread states which revision of each group
  1207. Xnamed in a configuration should be chosen.
  1208. XA configuration thread may contain dynamic specifiers
  1209. X(e.g., `choose the revisions I am currently working on,
  1210. Xand the most recent revisions otherwise'), which are bound
  1211. Xautomatically at build time.
  1212. XIt also provides a notification mechanism for alerting
  1213. Xmaintainers about the need to rebuild a system after a change.
  1214. X.PP
  1215. XRCS is based on a general model for describing
  1216. Xmulti-version/multi-configuration systems\u11\d.
  1217. XThe model describes systems using AND/OR graphs, where AND nodes represent
  1218. Xconfigurations, and OR nodes represent version groups.
  1219. XThe model gives rise to a suit of selection rules for
  1220. Xcomposing configurations, almost all of which are implemented in RCS.
  1221. XThe revisions selected by RCS are passed to MAKE for configuration building.
  1222. XRevision group management is modelled after SCCS.
  1223. XRCS retains SCCS's best features,
  1224. Xbut offers a significantly simpler user interface,
  1225. Xflexible selection rules, adequate integration with MAKE
  1226. Xand improved identification.
  1227. XA detailed comparison of RCS and SCCS appears in Reference 4.
  1228. X.PP
  1229. XAn important component of all revision control systems
  1230. Xis a program for computing deltas.
  1231. XSCCS and RCS use the program \fIdiff\fR\u2\d,
  1232. Xwhich first computes the longest common substring of two
  1233. Xrevisions, and then produces the delta from that substring.
  1234. XThe delta is simply an edit script consisting of deletion and
  1235. Xinsertion commands that generate one revision from the other.
  1236. X.PP
  1237. XA delta based on a longest common substring is not necessarily minimal,
  1238. Xbecause it does not take advantage of crossing block moves.
  1239. XCrossing block moves arise if two or more blocks of lines
  1240. X(e.g., procedures)
  1241. Xappear in a different order in two revisions.
  1242. XAn edit script derived from a longest common substring
  1243. Xfirst deletes the shorter of the two blocks, and then reinserts it.
  1244. XHeckel\u12\d
  1245. Xproposed an algorithm for detecting block moves, but
  1246. Xsince the algorithm is based on heuristics,
  1247. Xthere are conditions 
  1248. Xunder which the generated delta is far from minimal.
  1249. XDSEE uses this algorithm combined with blank compression,
  1250. Xapparently with satisfactory overall results.
  1251. XA new algorithm that is guaranteed to produce a minimal delta based on
  1252. Xblock moves appears in Reference 13. 
  1253. XA future release of RCS will use this algorithm.
  1254. X.PP
  1255. X\fIAcknowledgements\fR:
  1256. XMany people have helped make RCS a success by contributed criticisms, suggestions,
  1257. Xcorrections, and even whole new commands (including manual pages).
  1258. XThe list of people is too long to be
  1259. Xreproduced here, but my sincere thanks for their help and
  1260. Xgoodwill goes to all of them.
  1261. X
  1262. X.nr VS 12 pts
  1263. X.vs 12pts
  1264. X.SH
  1265. XAppendix: Synopsis of RCS Operations
  1266. X.LP
  1267. X.IP "\fIci \fB\- check in revisions\fR"
  1268. X.sp 0
  1269. X\fICi\fR stores the contents of a working file into the
  1270. Xcorresponding RCS file as a new revision.
  1271. XIf the RCS file doesn't exist, \fIci\fR creates it.
  1272. X\fICi\fR removes the working file, unless one of the options
  1273. X\fI-u\fR or \fI-l\fR is present.
  1274. XFor each check-in, \fIci\fR asks for a commentary
  1275. Xdescribing the changes relative to the previous revision.
  1276. X.sp 1
  1277. X\fICi\fR assigns the revision number given by the \fI-r\fR option;
  1278. Xif that option is missing, it derives the number from the
  1279. Xlock held by the user; if there is no lock and locking is not strict,
  1280. X\fIci\fR increments the number of the latest revision on the trunk.
  1281. XA side branch can only be started by explicitly specifying its
  1282. Xnumber with the \fI-r\fR option during check-in.
  1283. X.sp 1
  1284. X\fICi\fR also determines
  1285. Xwhether the revision to be checked in is different from the
  1286. Xprevious one, and asks whether to proceed if not.
  1287. XThis facility simplifies check-in operations for large systems,
  1288. Xbecause one need not remember which files were changed.
  1289. X.sp 1
  1290. XThe option \fI-k\fR searches the checked in file for identification
  1291. Xmarkers containing
  1292. Xthe attributes
  1293. Xrevision number, check-in date, author and state, and assigns these
  1294. Xto the new revision rather than computing them. This option is
  1295. Xuseful for software distribution: Recipients of distributed software
  1296. Xusing RCS should check in updates with the \fI-k\fR option.
  1297. XThis convention guarantees that revision numbers, check-in dates,
  1298. Xetc., are the same at all sites.
  1299. X.IP "\fIco \fB\- check out revisions\fR"
  1300. X.sp 0
  1301. X\fICo\fR retrieves revisions according to revision number,
  1302. Xdate, author and state attributes. It either places the revision
  1303. Xinto the working file, or prints it on the std. output.
  1304. X\fICo\fR always expands the identification markers.
  1305. X.IP "\fIident \fB\- extract identification markers\fR"
  1306. X.sp 0
  1307. X\fIIdent\fR extracts the identification markers expanded by \fIco\fR
  1308. Xfrom any file and prints them.
  1309. X.IP "\fIrcs \fB\- change RCS file attributes\fR"
  1310. X.sp 0
  1311. X\fIRcs\fR is an administrative operation that changes access lists,
  1312. Xlocks, unlocks,  breaks locks, toggles the strict-locking feature,
  1313. Xsets state attributes and symbolic revision numbers, changes the
  1314. Xdescription, and deletes revisions. A revision can
  1315. Xonly be deleted if it is not the fork of a side branch.
  1316. X.IP "\fIrcsclean \fB\- clean working directory\fR"
  1317. X.sp 0
  1318. X\fIRcsclean\fR removes working files that were checked out but never changed.
  1319. X.IP "\fIrcsdiff \fB\- compare revisions\fR"
  1320. X.sp 0
  1321. X\fIRcsdiff\fR compares two revisions and prints their
  1322. Xdifference, using the UNIX tool \fIdiff\fR.
  1323. XOne of the revisions compared may be checked out.
  1324. XThis command is useful for finding out about changes.
  1325. X.IP "\fIrcsfreeze \fB\- freeze a configuration\fR"
  1326. X.sp 0
  1327. X\fIRcsfreeze\fR assigns the same symbolic revision number
  1328. Xto a given revision in all RCS files.
  1329. XThis command is useful for accurately recording a configuration.
  1330. X.IP "\fIrcsmerge \fB\- merge revisions\fR"
  1331. X.sp 0
  1332. X\fIRcsmerge\fR merges two revisions, \fIrev1\fR and \fIrev2\fR,
  1333. Xwith respect to a common ancestor.
  1334. XA 3-way file comparison determines the segments of lines that
  1335. Xare (a) the same in all three revisions, or (b) the same in 2 revisions,
  1336. Xor (c) different in all three. For all segments of type (b) where
  1337. X\fIrev1\fR is the differing revision,
  1338. Xthe segment in \fIrev1\fR replaces the corresponding segment of \fIrev2\fR.
  1339. XType (c) indicates an overlapping change, is flagged as an error, and requires user
  1340. Xintervention to select the correct alternative.
  1341. X.IP "\fIrlog \fB\- read log messages\fR"
  1342. X.sp 0
  1343. X\fIRlog\fR prints the log messages and other information in an RCS file.
  1344. X.bp
  1345. X.LP
  1346. X.nr VS 12 pts
  1347. X.vs 12pts
  1348. X.]<
  1349. X.ds [F 1
  1350. X.]-
  1351. X.ds [K FELD02
  1352. X.ds [K MakeArticle
  1353. X.ds [A Feldman, Stuart I.
  1354. X.ds [D March 1979
  1355. X.ds [T Make - A Program for Maintaining Computer Programs
  1356. X.ds [J Software -- Practice and Experience
  1357. X.ds [V 9
  1358. X.ds [N 3
  1359. X.ds [P 255-265
  1360. X.nr [P 1
  1361. X.nr [T 0
  1362. X.nr [A 1
  1363. X.nr [O 0
  1364. X.][ 1 journal-article
  1365. X.ds [F 2
  1366. X.]-
  1367. X.ds [K HUNT01
  1368. X.ds [T An Algorithm for Differential File Comparison
  1369. X.ds [A Hunt, James W.
  1370. X.as [A " and McIlroy, M. D.
  1371. X.ds [I Computing Science Technical Report, Bell Laboratories
  1372. X.ds [R 41
  1373. X.ds [D June 1976
  1374. X.nr [T 0
  1375. X.nr [A 1
  1376. X.nr [O 0
  1377. X.][ 4 tech-report
  1378. X.ds [F 3
  1379. X.]-
  1380. X.ds [K SCCS
  1381. X.ds [A Rochkind, Marc J.
  1382. X.ds [D Dec. 1975
  1383. X.ds [T The Source Code Control System
  1384. X.ds [J IEEE Transactions on Software Engineering
  1385. X.ds [V SE-1
  1386. X.ds [N 4
  1387. X.ds [P 364-370
  1388. X.nr [P 1
  1389. X.nr [T 0
  1390. X.nr [A 1
  1391. X.nr [O 0
  1392. X.][ 1 journal-article
  1393. X.ds [F 4
  1394. X.]-
  1395. X.ds [K TICH08
  1396. X.ds [T Design, Implementation, and Evaluation of a Revision Control System
  1397. X.ds [A Tichy, Walter F.
  1398. X.ds [B Proceedings of the 6th International Conference on Software Engineering
  1399. X.ds [I ACM, IEEE, IPS, NBS
  1400. X.ds [D September 1982
  1401. X.ds [P 58-67
  1402. X.nr [P 1
  1403. X.nr [T 0
  1404. X.nr [A 1
  1405. X.nr [O 0
  1406. X.][ 3 article-in-book
  1407. X.ds [F 5
  1408. X.]-
  1409. X.ds [K LEBL01
  1410. X.ds [A Leblang, David B.
  1411. X.as [A " and Chase, Robert P.
  1412. X.ds [T Computer-Aided Software Engineering in a Distributed Workstation Environment
  1413. X.ds [O Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium
  1414. X.as [O " on Practical Software Development Environments.
  1415. X.ds [J SIGPLAN Notices
  1416. X.ds [V 19
  1417. X.ds [N 5
  1418. X.ds [D May 1984
  1419. X.ds [P 104-112
  1420. X.nr [P 1
  1421. X.nr [T 0
  1422. X.nr [A 1
  1423. X.nr [O 0
  1424. X.][ 1 journal-article
  1425. X.ds [F 1
  1426. X.ds [F 3
  1427. X.ds [F 6
  1428. X.]-
  1429. X.ds [K SCCSEval
  1430. X.ds [A Glasser, Alan L.
  1431. X.ds [D Nov. 1978
  1432. X.ds [T The Evolution of a Source Code Control System
  1433. X.ds [J Software Engineering Notes
  1434. X.ds [V 3
  1435. X.ds [N 5
  1436. X.ds [P 122-125
  1437. X.nr [P 1
  1438. X.ds [O Proceedings of the Software Quality and Assurance Workshop.
  1439. X.nr [T 0
  1440. X.nr [A 1
  1441. X.nr [O 1
  1442. X.][ 1 journal-article
  1443. X.ds [F 5
  1444. X.ds [F 7
  1445. X.]-
  1446. X.ds [K IBMClearCaster
  1447. X.ds [A Brown, H.B.
  1448. X.ds [D 1970
  1449. X.ds [T The Clear/Caster System
  1450. X.ds [J Nato Conference on Software Engineering, Rome
  1451. X.nr [T 0
  1452. X.nr [A 1
  1453. X.nr [O 0
  1454. X.][ 1 journal-article
  1455. X.ds [F 3
  1456. X.ds [F 8
  1457. X.]-
  1458. X.ds [K HabermannSDC
  1459. X.ds [A Habermann, A. Nico
  1460. X.ds [D Jan. 1979
  1461. X.ds [T A Software Development Control System
  1462. X.ds [I Technical Report, Carnegie-Mellon University, Department of Computer Science
  1463. X.nr [T 0
  1464. X.nr [A 0
  1465. X.nr [O 0
  1466. X.][ 2 book
  1467. X.ds [F 9
  1468. X.]-
  1469. X.ds [K CMS
  1470. X.ds [A DEC,
  1471. X.ds [T Code Management System
  1472. X.ds [I Digital Equipment Corporation
  1473. X.ds [O Document No. EA-23134-82
  1474. X.ds [D 1982
  1475. X.nr [T 0
  1476. X.nr [A 0
  1477. X.nr [O 0
  1478. X.][ 2 book
  1479. X.ds [F 10
  1480. X.]-
  1481. X.ds [K LAMP01
  1482. X.ds [A Lampson, Butler W.
  1483. X.as [A " and Schmidt, Eric E.
  1484. X.ds [T Practical Use of a Polymorphic Applicative Language
  1485. X.ds [B Proceedings of the 10th Symposium on Principles of Programming Languages
  1486. X.ds [I ACM
  1487. X.ds [P 237-255
  1488. X.nr [P 1
  1489. X.ds [D January 1983
  1490. X.nr [T 0
  1491. X.nr [A 1
  1492. X.nr [O 0
  1493. X.][ 3 article-in-book
  1494. X.ds [F 5
  1495. X.ds [F 11
  1496. X.]-
  1497. X.ds [K TICH07
  1498. X.ds [T A Data Model for Programming Support Environments and its Application
  1499. X.ds [A Tichy, Walter F.
  1500. X.ds [B Automated Tools for Information System Design and Development
  1501. X.ds [E Hans-Jochen Schneider and Anthony I. Wasserman
  1502. X.ds [C Amsterdam
  1503. X.ds [I North-Holland Publishing Company
  1504. X.ds [D 1982
  1505. X.nr [T 0
  1506. X.nr [A 1
  1507. X.nr [O 0
  1508. X.][ 3 article-in-book
  1509. X.ds [F 4
  1510. X.ds [F 2
  1511. X.ds [F 12
  1512. X.]-
  1513. X.ds [K HECK01
  1514. X.ds [T A Technique for Isolating Differences Between Files
  1515. X.ds [A Heckel, Paul
  1516. X.ds [J Communications of the ACM
  1517. X.ds [D April 1978
  1518. X.ds [V 21
  1519. X.ds [N 4
  1520. X.ds [P 264-268
  1521. X.nr [P 1
  1522. X.nr [T 0
  1523. X.nr [A 0
  1524. X.nr [O 0
  1525. X.][ 1 journal-article
  1526. X.ds [F 13
  1527. X.]-
  1528. X.ds [K TICH11
  1529. X.ds [T The String-to-String Correction Problem with Block Moves
  1530. X.ds [A Tichy, Walter F.
  1531. X.ds [D Nov. 1984
  1532. X.ds [J ACM Transactions on Computer Systems
  1533. X.ds [V 2
  1534. X.ds [N 4
  1535. X.ds [P 309-321
  1536. X.nr [P 1
  1537. X.nr [T 0
  1538. X.nr [A 1
  1539. X.nr [O 0
  1540. X.][ 1 journal-article
  1541. X.]>
  1542. SHAR_EOF
  1543. echo "extracting doc/rcs_functs.ms"
  1544. sed 's/^X//' << \SHAR_EOF > doc/rcs_functs.ms
  1545. X.SH
  1546. XFunctions of RCS (Revision Control System)
  1547. X.PP
  1548. XRCS manages software libraries. It greatly increases programmer productivity
  1549. Xby providing the following functions.
  1550. X.IP 1.
  1551. XRCS stores and retrieves multiple revisions of program and other text.
  1552. XThus, one can maintain one or more releases while developing the next
  1553. Xrelease, with a minimum of space overhead. Changes no longer destroy the
  1554. Xoriginal -- previous revisions remain accessible.
  1555. X.RS
  1556. X.IP a.
  1557. XMaintains each module as a tree of revisions.
  1558. X.IP b.
  1559. XProject libraries can
  1560. Xbe organized centrally, decentralized, or any way you like.
  1561. X.IP c.
  1562. XRCS works for any type of text: programs, documentation, memos, papers,
  1563. Xgraphics, VLSI layouts, form letters, etc.
  1564. X.RE
  1565. X.IP 2.
  1566. XRCS maintains a complete history of changes.
  1567. XThus, one can find out what happened to a module easily
  1568. Xand quickly, without having to compare source listings or
  1569. Xhaving to track down colleagues.
  1570. X.RS
  1571. X.IP a.
  1572. XRCS performs automatic record keeping.
  1573. X.IP b.
  1574. XRCS logs all changes automatically.
  1575. X.IP c.
  1576. XRCS guarantees project continuity.
  1577. X.RE
  1578. X.IP 3.
  1579. XRCS manages multiple lines of development.
  1580. X.IP 4.
  1581. XRCS can merge multiple lines of development.
  1582. XThus, when several parallel lines of development must be consolidated
  1583. Xinto one line, the merging of changes is automatic.
  1584. X.IP 5.
  1585. XRCS flags coding conflicts.
  1586. XIf two or more lines of development modify the same section of code,
  1587. XRCS can alert programmers about overlapping changes.
  1588. X.IP 6.
  1589. XRCS resolves access conflicts.
  1590. XWhen two or more programmers wish to modify the same revision,
  1591. XRCS alerts the programmers and makes sure that one modification won't wipe
  1592. Xout the other one.
  1593. X.IP 7.
  1594. XRCS provides high-level retrieval functions.
  1595. XRevisions can be retrieved according to ranges of revision numbers,
  1596. Xsymbolic names, dates, authors, and states.
  1597. X.IP 8.
  1598. XRCS provides release and configuration control.
  1599. XRevisions can be marked as released, stable, experimental, etc.
  1600. XConfigurations of modules can be described simply and directly.
  1601. X.IP 9.
  1602. XRCS performs automatic identification of modules with name, revision
  1603. Xnumber, creation time, author, etc.
  1604. XThus, it is always possible to determine which revisions of which
  1605. Xmodules make up a given configuration.
  1606. X.IP 10.
  1607. XProvides high-level management visibility.
  1608. XThus, it is easy to track the status of a software project.
  1609. X.RS
  1610. X.IP a.
  1611. XRCS provides a complete change history.
  1612. X.IP b.
  1613. XRCS records who did what when to which revision of which module.
  1614. X.RE
  1615. X.IP 11.
  1616. XRCS is fully compatible with existing software development tools.
  1617. XRCS is unobtrusive -- its interface to the file system is such that
  1618. Xall your existing software tools can be used as before.
  1619. X.IP 12.
  1620. XRCS' basic user interface is extremely simple. The novice need to learn
  1621. Xonly two commands. Its more sophisticated features have been
  1622. Xtuned towards advanced software development environments and the
  1623. Xexperienced software professional.
  1624. X.IP 13.
  1625. XRCS simplifies software distribution if customers
  1626. Xmaintain sources with RCS also. This technique assures proper
  1627. Xidentification of versions and configurations, and tracking of customer
  1628. Xmodifications. Customer modifications can be merged into distributed
  1629. Xversions locally or by the development group.
  1630. X.IP 14.
  1631. XRCS needs little extra space for the revisions (only the differences).
  1632. XIf intermediate revisions are deleted, the corresponding
  1633. Xdifferences are compressed into the shortest possible form.
  1634. X.IP 15.
  1635. XRCS is implemented with reverse deltas. This means that
  1636. Xthe latest revision, which is the one that is accessed most often,
  1637. Xis stored intact. All others are regenerated from the latest one
  1638. Xby applying reverse deltas (backward differences). This
  1639. Xresults in fast access time for the revision needed most often.
  1640. SHAR_EOF
  1641. echo "extracting doc/ci.1l"
  1642. sed 's/^X//' << \SHAR_EOF > doc/ci.1l
  1643. X.TH CI 1L "" "Purdue University"
  1644. X.SH NAME
  1645. Xci \- check in RCS revisions
  1646. X.SH SYNOPSIS
  1647. X.B ci
  1648. X[ options ]
  1649. Xfile ...
  1650. X.SH DESCRIPTION
  1651. X.I Ci
  1652. Xstores new revisions into RCS files.
  1653. XEach file name ending in `,v' is taken to be an RCS file, all others
  1654. Xare assumed to be working files containing new revisions.
  1655. X\fICi\fR deposits the contents of each working file
  1656. Xinto the corresponding RCS file.
  1657. XIf only a working file is given, \fIci\fR tries to find the corresponding
  1658. XRCS file in the directory ./RCS and then in the current directory.
  1659. XFor more details, see the file naming section below.
  1660. X.PP
  1661. XFor \fIci\fR to work, the caller's login must be on the access list,
  1662. Xexcept if the access list is empty or the caller is the superuser or the
  1663. Xowner of the file.
  1664. XTo append a new revision to an existing branch, the tip revision on
  1665. Xthat branch must be locked by the caller. Otherwise, only a 
  1666. Xnew branch can be created. This restriction is not enforced
  1667. Xfor the owner of the file, unless locking is set to \fIstrict\fR
  1668. X(see
  1669. X.IR rcs (1L)).
  1670. XA lock held by someone else may be broken with the \fIrcs\fR command.
  1671. X.PP
  1672. XNormally, \fIci\fR checks whether the revision to be deposited is different
  1673. Xfrom the preceding one. If it is not different, \fIci\fR
  1674. Xeither aborts the deposit (if
  1675. X.B \-q
  1676. Xis given) or asks whether to abort
  1677. X(if
  1678. X.B \-q
  1679. Xis omitted). A deposit can be forced with the
  1680. X.B \-f
  1681. Xoption.
  1682. X.PP
  1683. XFor each revision deposited,
  1684. X.I ci
  1685. Xprompts for a log message.
  1686. XThe log message should summarize the change and must be terminated with
  1687. Xa line containing a single `.' or a control-D.
  1688. XIf several files are checked in, \fIci\fR asks whether to reuse the
  1689. Xprevious log message.
  1690. XIf the standard input is not a terminal, \fIci\fR suppresses the prompt 
  1691. Xand uses the same log message for all files.
  1692. XSee also \fB\-m\fR.
  1693. X.PP
  1694. XThe number of the deposited revision can be given by any of the options
  1695. X\fB\-r\fR, \fB\-f\fR, \fB\-k\fR, \fB\-l\fR, \fB\-u\fR, or \fB\-q\fR.
  1696. X.PP
  1697. XIf the RCS file does not exist, \fIci\fR creates it and
  1698. Xdeposits the contents of the working file as the initial revision
  1699. X(default number: 1.1).
  1700. XThe access list is initialized to empty.
  1701. XInstead of the log message, \fIci\fR requests descriptive text (see
  1702. X\fB\-t\fR below).
  1703. X.TP 10
  1704. X.BR \-r [\fIrev\fR] 
  1705. Xassigns the revision number \fIrev\fR 
  1706. Xto the checked-in revision, releases the corresponding lock, and
  1707. Xdeletes the working file. This is the default.
  1708. X\fIRev\fR may be symbolic, numeric, or mixed.
  1709. X
  1710. XIf \fIrev\fR is a revision number, it must be higher than the latest
  1711. Xone on the branch to which \fIrev\fR belongs, or must start a new branch.
  1712. X
  1713. XIf \fIrev\fR is a branch rather than a revision number,
  1714. Xthe new revision is appended to that branch. The level number is obtained
  1715. Xby incrementing the tip revision number of that branch.
  1716. XIf \fIrev\fR indicates a non-existing branch,
  1717. Xthat branch is created with the initial revision numbered
  1718. X.IR rev .1.
  1719. X
  1720. X.ne 8
  1721. XIf \fIrev\fR is omitted, \fIci\fR tries to derive the new revision number from
  1722. Xthe caller's last lock. If the caller has locked the tip revision of a branch,
  1723. Xthe new revision is appended to that branch. The new revision number is obtained
  1724. Xby incrementing the tip revision number.
  1725. XIf the caller locked a non-tip revision, a new branch is started at
  1726. Xthat revision by incrementing the highest branch number at that revision.
  1727. XThe default initial branch and level numbers are 1.
  1728. X
  1729. XIf \fIrev\fR is omitted and the caller has no lock, but he is the owner
  1730. Xof the file and locking
  1731. Xis not set to \fIstrict\fR, then the revision is appended to the
  1732. Xdefault branch (normally the trunk; see the
  1733. X.B \-b
  1734. Xoption of
  1735. X.IR rcs (1L)).
  1736. X
  1737. XException: On the trunk, revisions can be appended to the end, but
  1738. Xnot inserted.
  1739. X.TP 10
  1740. X.BR \-f [\fIrev\fR]
  1741. Xforces a deposit; the new revision is deposited even it is not different
  1742. Xfrom the preceding one.
  1743. X.TP 10
  1744. X.BR \-k [\fIrev\fR]
  1745. Xsearches the working file for keyword values to determine its revision number,
  1746. Xcreation date, state, and author (see \fIco\fR(1)), and assigns these
  1747. Xvalues to the deposited revision, rather than computing them locally.
  1748. XIt also generates a default login message noting the login of the caller
  1749. Xand the actual checkin date.
  1750. XThis option is useful for software distribution. A revision that is sent to
  1751. Xseveral sites should be checked in with the \fB\-k\fR option at these sites to 
  1752. Xpreserve the original number, date, author, and state.
  1753. XThe extracted keyword values and the default log message may be overridden
  1754. Xwith the options \fB\-r\fR, \fB\-d\fR, \fB\-s\fR, \fB\-w\fR, and \fB\-m\fR.
  1755. X.TP 10
  1756. X.BR \-l [\fIrev\fR]
  1757. Xworks like \fB\-r\fR, except it performs an additional \fIco \fB\-l\fR for the
  1758. Xdeposited revision. Thus, the deposited revision is immediately
  1759. Xchecked out again and locked.
  1760. XThis is useful for saving a revision although one wants to continue 
  1761. Xediting it after the checkin.
  1762. X.TP 10
  1763. X.BR \-u [\fIrev\fR]
  1764. Xworks like \fB\-l\fR, except that the deposited revision is not locked.
  1765. XThis is useful if one wants to process (e.g., compile) the revision
  1766. Ximmediately after checkin.
  1767. X.TP 10
  1768. X.BR \-q [\fIrev\fR] 
  1769. Xquiet mode; diagnostic output is not printed.
  1770. XA revision that is not different from the preceding one is not deposited,
  1771. Xunless \fB\-f\fR is given.
  1772. X.TP 10
  1773. X.BI \-d "date"
  1774. Xuses \fIdate\fR for the checkin date and time.
  1775. X\fIDate\fR may be specified in free format as explained in \fIco\fR(1).
  1776. XUseful for lying about the checkin date, and for
  1777. X.B \-k
  1778. Xif no date is available.
  1779. X.TP 10
  1780. X.BI \-m "msg"
  1781. Xuses the string \fImsg\fR as the log message for all revisions checked in.
  1782. X.TP 10
  1783. X.BI \-n "name"
  1784. Xassigns the symbolic name \fIname\fR to the number of the checked-in revision.
  1785. X\fICi\fR prints an error message if \fIname\fR is already assigned to another
  1786. Xnumber.
  1787. X.TP 10
  1788. X.BI \-N "name"
  1789. Xsame as \fB\-n\fR, except that it overrides a previous assignment of \fIname\fR.
  1790. X.TP
  1791. X.BI \-s "state"
  1792. Xsets the state of the checked-in revision to the identifier \fIstate\fR.
  1793. XThe default is \fIExp\fR.
  1794. X.TP
  1795. X.BR \-t [\fItxtfile\fR]
  1796. Xwrites descriptive text into the RCS file (deletes the existing text).
  1797. XIf \fItxtfile\fR is omitted, 
  1798. X\fIci\fR prompts the user for text supplied from the standard input,
  1799. Xterminated with a line containing a single `.' or control-D.
  1800. XOtherwise, the descriptive text is copied from the file \fItxtfile\fR.
  1801. XDuring initialization, descriptive text is requested
  1802. Xeven if \fB\-t\fR is not given.
  1803. XThe prompt is suppressed if standard input is not a terminal.
  1804. X.TP
  1805. X.BI \-w "login"
  1806. Xuses \fIlogin\fR for the author field of the deposited revision.
  1807. XUseful for lying about the author, and for
  1808. X.B \-k
  1809. Xif no author is available.
  1810. X.SH "FILE NAMING"
  1811. XPairs of RCS files and working files may be specified in 3 ways (see also the
  1812. Xexample section of \fIco\fR(1)).
  1813. X.PP
  1814. X1) Both the RCS file and the working file are given. The RCS file name is of
  1815. Xthe form \fIpath1/workfile,v\fR
  1816. Xand the working file name is of the form
  1817. X\fIpath2/workfile\fR, where 
  1818. X\fIpath1/\fR and
  1819. X\fIpath2/\fR are (possibly different or empty) paths and
  1820. X\fIworkfile\fR is a file name.
  1821. X.PP
  1822. X2) Only the RCS file is given. 
  1823. XThen the working file is assumed to be in the current
  1824. Xdirectory and its name is derived from the name of the RCS file
  1825. Xby removing \fIpath1/\fR and the suffix \fI,v\fR.
  1826. X.PP
  1827. X3) Only the working file is given. 
  1828. XThen \fIci\fR looks for an RCS file of the form
  1829. X\fIpath2/RCS/workfile,v\fR or \fIpath2/workfile,v\fR (in this order).
  1830. X.PP
  1831. XIf the RCS file is specified without a path in 1) and 2), then \fIci\fR
  1832. Xlooks for the RCS file first in the directory ./RCS and then in the current
  1833. Xdirectory.
  1834. X.SH "FILE MODES"
  1835. XAn RCS file created by \fIci\fR inherits the read and execute permissions
  1836. Xfrom the working file. If the RCS file exists already, \fIci\fR
  1837. Xpreserves its read and execute permissions.
  1838. X\fICi\fR always turns off all write permissions of RCS files. 
  1839. X.SH FILES
  1840. XThe caller of the command
  1841. Xmust have read/write permission for the directories containing
  1842. Xthe RCS file and the working file, and read permission for the RCS file itself.
  1843. XA number of temporary files are created.
  1844. XA semaphore file is created in the directory containing the RCS file.
  1845. X\fICi\fR always creates a new RCS file and unlinks the old one.
  1846. XThis strategy makes links to RCS files useless.
  1847. X.SH DIAGNOSTICS
  1848. XFor each revision,
  1849. X\fIci\fR prints the RCS file, the working file, and the number
  1850. Xof both the deposited and the preceding revision.
  1851. XThe exit status always refers to the last file checked in,
  1852. Xand is 0 if the operation was successful, 1 otherwise.
  1853. X.SH IDENTIFICATION
  1854. X.de VL
  1855. X\\$2
  1856. X..
  1857. XAuthor: Walter F. Tichy,
  1858. XPurdue University, West Lafayette, IN, 47907.
  1859. X.sp 0
  1860. XRevision Number:
  1861. X.VL $Revision: 1.3 $
  1862. X; Release Date:
  1863. X.VL $Date: 89/05/02 11:12:08 $
  1864. X\&.
  1865. X.sp 0
  1866. XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
  1867. X.SH SEE ALSO
  1868. Xco(1L), ident(1L), rcs(1L), rcsdiff(1L), rcsintro(1L), rcsmerge(1L), rlog(1L),
  1869. Xrcsfile(5L)
  1870. X.sp 0
  1871. XWalter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control
  1872. XSystem," in \fIProceedings of the 6th International Conference on Software
  1873. XEngineering\fR, IEEE, Tokyo, Sept. 1982.
  1874. SHAR_EOF
  1875. echo "extracting doc/co.1l"
  1876. sed 's/^X//' << \SHAR_EOF > doc/co.1l
  1877. X.TH CO 1L "" "Purdue University"
  1878. X.SH NAME
  1879. Xco \- check out RCS revisions
  1880. X.SH SYNOPSIS
  1881. X.B co
  1882. X[ options ]
  1883. Xfile ...
  1884. X.SH DESCRIPTION
  1885. X.I Co
  1886. Xretrieves a revision from each RCS file and stores it into
  1887. Xthe corresponding working file.
  1888. XEach file name ending in `,v' is taken to be an RCS file;
  1889. Xall other files are assumed to be working files.
  1890. XIf only a working file is given, \fIco\fR tries to find the corresponding
  1891. XRCS file in the directory ./RCS and then in the current directory.
  1892. XFor more details, see the file naming section below.
  1893. X.PP
  1894. XRevisions of an RCS file may be checked out locked or unlocked. Locking a
  1895. Xrevision prevents overlapping updates. A revision checked out for reading or
  1896. Xprocessing (e.g., compiling) need not be locked. A revision checked out
  1897. Xfor editing and later checkin must normally be locked. \fICo\fR with locking
  1898. Xfails if the revision to be checked out is currently locked by another user.
  1899. X(A lock may be broken with the
  1900. X.IR rcs (1L)
  1901. Xcommand.)
  1902. X\fICo\fR with locking also requires the caller to be on the access list of
  1903. Xthe RCS file, unless he is the owner of the
  1904. Xfile or the superuser, or the access list is empty.
  1905. X\fICo\fR without locking is not subject to accesslist restrictions, and is
  1906. Xnot affected by the presence of locks.
  1907. X.PP
  1908. XA revision is selected by options for revision or branch number,
  1909. Xcheckin date/time, author, or state.
  1910. XWhen the selection options
  1911. Xare applied in combination, \fIco\fR retrieves the latest revision
  1912. Xthat satisfies all of them.
  1913. XIf none of the selection options
  1914. Xis specified, \fIco\fR retrieves the latest revision
  1915. Xon the default branch (normally the trunk, see the
  1916. X.B \-b
  1917. Xoption of
  1918. X.IR rcs (1L)).
  1919. XA revision or branch number may be attached
  1920. Xto any of the options
  1921. X\fB\-f\fR, \fB\-l\fR, \fB\-p\fR, \fB\-q\fR, \fB\-r\fR, or \fB\-u\fR.
  1922. XThe options \fB\-d\fR (date), \fB\-s\fR (state), and \fB\-w\fR (author)
  1923. Xretrieve from a single branch, the \fIselected\fR branch,
  1924. Xwhich is either specified by one of
  1925. X\fB\-f\fR,..., \fB\-u\fR, or the default branch.
  1926. X.PP
  1927. XA \fIco\fR command applied to an RCS
  1928. Xfile with no revisions creates a zero-length working file.
  1929. X\fICo\fR always performs keyword substitution (see below).
  1930. X.PP
  1931. X.TP 11
  1932. X.BR \-r [\fIrev\fR]
  1933. Xretrieves the latest revision whose number is less than or equal to \fIrev\fR.
  1934. XIf \fIrev\fR indicates a branch rather than a revision,
  1935. Xthe latest revision on that branch is retrieved.
  1936. XIf \fIrev\fR is omitted, the latest revision on the default branch
  1937. X(see the
  1938. X.B \-b
  1939. Xoption of
  1940. X.IR rcs (1L))
  1941. Xis retrieved.
  1942. X\fIRev\fR is composed of one or more numeric or symbolic fields
  1943. Xseparated by `.'. The numeric equivalent of a symbolic field
  1944. Xis specified with the \fB\-n\fR option of the commands
  1945. X.IR ci (1L)
  1946. Xand
  1947. X.IR rcs (1L).
  1948. X.TP 11
  1949. X.BR \-l [\fIrev\fR]
  1950. Xsame as \fB\-r\fR, except that it also locks the retrieved revision for
  1951. Xthe caller.  See option \fB\-r\fR for handling of the revision number
  1952. X.I rev .
  1953. X.TP 11
  1954. X.BR \-u [\fIrev\fR]
  1955. Xsame as \fB\-r\fR, except that it unlocks the retrieved revision (if it was
  1956. Xlocked by the caller). If \fIrev\fR is omitted, \fB\-u\fR
  1957. Xretrieves the latest revision locked by the caller; if no such lock exists,
  1958. Xit retrieves the latest revision on the default branch.
  1959. X.TP 11
  1960. X.BR \-f [\fIrev\fR]
  1961. Xforces the overwriting of the working file;
  1962. Xuseful in connection with \fB\-q\fR.
  1963. XSee also the section on file modes below.
  1964. X.TP 11
  1965. X.BR \-p [\fIrev\fR]
  1966. Xprints the retrieved revision on the standard output rather than storing it
  1967. Xin the working file.
  1968. XThis option is useful when \fIco\fR
  1969. Xis part of a pipe.
  1970. X.TP 11
  1971. X.BR \-q [\fIrev\fR]
  1972. Xquiet mode; diagnostics are not printed.
  1973. X.TP 11
  1974. X.BI \-d "date"
  1975. Xretrieves the latest revision on the selected branch whose checkin date/time is less than or equal to \fIdate\fR.
  1976. XThe date and time may be given in free format and are converted to local time.
  1977. XExamples of formats for \fIdate\fR:
  1978. X.ne 5
  1979. X.nf
  1980. X
  1981. X\fI22-April-1982, 17:20-CDT,
  1982. X2:25 AM, Dec. 29, 1983,
  1983. XTue-PDT, 1981, 4pm Jul 21\fR         \fR(free format),
  1984. X\fIFri, April 16 15:52:25 EST 1982 \fR(output of ctime).
  1985. X.fi
  1986. X
  1987. XMost fields in the date and time may be defaulted.
  1988. X\fICo\fR determines the defaults in the order year, month, day,
  1989. Xhour, minute, and second (most to least significant). At least one of these
  1990. Xfields must be provided. For omitted fields that are of higher significance
  1991. Xthan the highest provided field,
  1992. Xthe current values are assumed. For all other omitted fields,
  1993. Xthe lowest possible values are assumed.
  1994. XFor example, the date "20, 10:30" defaults to
  1995. X10:30:00 of the 20th of the current month and current year.
  1996. XThe date/time must be quoted if it contains spaces.
  1997. X.TP 11
  1998. X.BI \-s "state"
  1999. Xretrieves the latest revision on the selected branch whose state is set to \fIstate\fR.
  2000. X.TP 11
  2001. X.BR \-w [\fIlogin\fR]
  2002. Xretrieves the latest revision on the selected branch which was checked in
  2003. Xby the user with login name \fIlogin\fR. If the argument \fIlogin\fR is
  2004. Xomitted, the caller's login is assumed.
  2005. X.TP 11
  2006. X.BI \-j joinlist
  2007. Xgenerates a new revision which is the join of the revisions on \fIjoinlist\fR.
  2008. X\fIJoinlist\fR is a comma-separated list of pairs of the form
  2009. X\fIrev2:rev3\fR, where \fIrev2\fR and \fIrev3\fR are (symbolic or numeric)
  2010. Xrevision numbers.
  2011. XFor the initial such pair, \fIrev1\fR denotes the revision selected
  2012. Xby the above options \fB\-r\fR, ..., \fB\-w\fR. For all other pairs, \fIrev1\fR
  2013. Xdenotes the revision generated by the previous pair. (Thus, the output
  2014. Xof one join becomes the input to the next.)
  2015. X
  2016. XFor each pair, \fIco\fR joins revisions \fIrev1\fR and \fIrev3\fR
  2017. Xwith respect to \fIrev2\fR.
  2018. XThis means that all changes that transform
  2019. X\fIrev2\fR into \fIrev1\fR are applied to a copy of \fIrev3\fR.
  2020. XThis is particularly useful if \fIrev1\fR
  2021. Xand \fIrev3\fR are the ends of two branches that have \fIrev2\fR as a common
  2022. Xancestor. If \fIrev1\fR < \fIrev2\fR < \fIrev3\fR on the same branch,
  2023. Xjoining generates a new revision which is like \fIrev3\fR, but with all
  2024. Xchanges that lead from \fIrev1\fR to \fIrev2\fR undone.
  2025. XIf changes from \fIrev2\fR to \fIrev1\fR overlap with changes from
  2026. X\fIrev2\fR to \fIrev3\fR, \fIco\fR prints a warning and includes the
  2027. Xoverlapping sections, delimited by the lines \fI<<<<<<<\ rev1,
  2028. X=======\fR, and \fI>>>>>>>\ rev3\fR.
  2029. X
  2030. XFor the initial pair, \fIrev2\fR may be omitted. The default is the common
  2031. Xancestor.
  2032. XIf any of the arguments indicate branches, the latest revisions
  2033. Xon those branches are assumed.
  2034. XThe options \fB\-l\fR and \fB\-u\fR lock or unlock \fIrev1\fR.
  2035. X.SH "KEYWORD SUBSTITUTION"
  2036. XStrings of the form \fI$keyword$\fR and \fI$keyword:...$\fR embedded in
  2037. Xthe text are replaced
  2038. Xwith strings of the form \fI$keyword:\ value\ $\fR,
  2039. Xwhere \fIkeyword\fR and \fIvalue\fR are pairs listed below.
  2040. XKeywords may be embedded in literal strings
  2041. Xor comments to identify a revision.
  2042. X.PP
  2043. XInitially, the user enters strings of the form \fI$keyword$\fR.
  2044. XOn checkout, \fIco\fR replaces these strings with strings of the form
  2045. X\fI$keyword:\ value\ $\fR. If a revision containing strings of the latter form
  2046. Xis checked back in, the value fields will be replaced during the next
  2047. Xcheckout.
  2048. XThus, the keyword values are automatically updated on checkout.
  2049. X.PP
  2050. XKeywords and their corresponding values:
  2051. X.TP 13
  2052. X$\&Author$
  2053. XThe login name of the user who checked in the revision.
  2054. X.TP
  2055. X$\&Date$
  2056. XThe date and time the revision was checked in.
  2057. X.TP
  2058. X$\&Header$
  2059. XA standard header containing the full pathname of the RCS file, the
  2060. Xrevision number, the date, the author, the state, and the locker (if locked).
  2061. X.TP
  2062. X$\&Id$
  2063. XSame as $\&Header$, except that the RCS file name is without a path.
  2064. X.TP
  2065. X$\&Locker$
  2066. XThe login name of the user who locked the revision (empty if not locked).
  2067. X.TP
  2068. X$\&Log$
  2069. XThe log message supplied during checkin, preceded by a header
  2070. Xcontaining the RCS file name, the revision number, the author, and the date.
  2071. XExisting log messages are NOT replaced.
  2072. XInstead, the new log message is inserted after \fI$\&Log:...$\fR.
  2073. XThis is useful for
  2074. Xaccumulating a complete change log in a source file.
  2075. X.TP
  2076. X$\&RCSfile$
  2077. XThe name of the RCS file without path.
  2078. X.TP
  2079. X$\&Revision$
  2080. XThe revision number assigned to the revision.
  2081. X.TP
  2082. X$\&Source$
  2083. XThe full pathname of the RCS file.
  2084. X.TP
  2085. X$\&State$
  2086. XThe state assigned to the revision with the
  2087. X.B \-s
  2088. Xoption of
  2089. X.IR rcs (1L)
  2090. Xor
  2091. X.IR ci (1L).
  2092. X.TP
  2093. X.SH "FILE NAMING"
  2094. XPairs of RCS files and working files may be specified in 3 ways (see also the
  2095. Xexample section).
  2096. X.PP
  2097. X1) Both the RCS file and the working file are given. The RCS file name is of
  2098. Xthe form \fIpath1/workfile,v\fR
  2099. Xand the working file name is of the form
  2100. X\fIpath2/workfile\fR, where
  2101. X\fIpath1/\fR and
  2102. X\fIpath2/\fR are (possibly different or empty) paths and
  2103. X\fIworkfile\fR is a file name.
  2104. X.PP
  2105. X2) Only the RCS file is given. Then the working file is created in the current
  2106. Xdirectory and its name is derived from the name of the RCS file
  2107. Xby removing \fIpath1/\fR and the suffix \fI,v\fR.
  2108. X.PP
  2109. X3) Only the working file is given.
  2110. XThen \fIco\fR looks for an RCS file of the form
  2111. X\fIpath2/RCS/workfile,v\fR or \fIpath2/workfile,v\fR (in this order).
  2112. X.PP
  2113. XIf the RCS file is specified without a path in 1) and 2), then \fIco\fR
  2114. Xlooks for the RCS file first in the directory ./RCS and then in the current
  2115. Xdirectory.
  2116. X.SH EXAMPLES
  2117. XSuppose the current directory contains a subdirectory `RCS' with an RCS file
  2118. X`io.c,v'. Then all of the following commands retrieve the latest
  2119. Xrevision from `RCS/io.c,v' and store it into `io.c'.
  2120. X.nf
  2121. X.sp
  2122. X    co  io.c;    co  RCS/io.c,v;   co  io.c,v;
  2123. X    co  io.c  RCS/io.c,v;    co  io.c  io.c,v;
  2124. X    co  RCS/io.c,v  io.c;    co  io.c,v  io.c;
  2125. X.fi
  2126. X.SH "FILE MODES"
  2127. XThe working file inherits the read and execute permissions from the RCS
  2128. Xfile. In addition, the owner write permission is turned on, unless the file
  2129. Xis checked out unlocked and locking is set to \fIstrict\fR (see
  2130. X.IR rcs (1L)).
  2131. X.PP
  2132. XIf a file with the name of the working file exists already and has write
  2133. Xpermission, \fIco\fR aborts the checkout if \fB\-q\fR is given, or asks
  2134. Xwhether to abort if \fB\-q\fR is not given. If the existing working file is
  2135. Xnot writable or \fB\-f\fR is given, the working file is deleted without asking.
  2136. X.SH FILES
  2137. XThe caller of the command must have write permission in the working
  2138. Xdirectory, read permission for the RCS file, and either read permission
  2139. X(for reading) or read/write permission (for locking) in the directory which
  2140. Xcontains the RCS file.
  2141. X.PP
  2142. XA number of temporary files are created.
  2143. XA semaphore file is created in the directory of the RCS file
  2144. Xto prevent simultaneous update.
  2145. X.SH DIAGNOSTICS
  2146. XThe RCS file name, the working file name,
  2147. Xand the revision number retrieved are
  2148. Xwritten to the diagnostic output.
  2149. XThe exit status always refers to the last file checked out,
  2150. Xand is 0 if the operation was successful, 1 otherwise.
  2151. X.SH IDENTIFICATION
  2152. X.de VL
  2153. X\\$2
  2154. X..
  2155. XAuthor: Walter F. Tichy,
  2156. XPurdue University, West Lafayette, IN, 47907.
  2157. X.sp 0
  2158. XRevision Number:
  2159. X.VL $Revision: 1.4 $
  2160. X; Release Date:
  2161. X.VL $Date: 89/05/02 11:20:22 $
  2162. X\&.
  2163. X.sp 0
  2164. XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
  2165. X.SH SEE ALSO
  2166. Xci(1L), ident(1L), rcs(1L), rcsdiff(1L), rcsintro(1L), rcsmerge(1L), rlog(1L),
  2167. Xrcsfile(5L)
  2168. X.sp 0
  2169. XWalter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control
  2170. XSystem," in \fIProceedings of the 6th International Conference on Software
  2171. XEngineering\fR, IEEE, Tokyo, Sept. 1982.
  2172. X.SH LIMITATIONS
  2173. XThe option \fB\-d\fR gets confused in some circumstances,
  2174. Xand accepts no date before 1970.
  2175. XLinks to the RCS and working files are not preserved.
  2176. XThere is no way to suppress the expansion of keywords, except
  2177. Xby writing them differently. In nroff and troff, this is done by embedding the
  2178. Xnull-character `\\&' into the keyword.
  2179. X.SH BUGS
  2180. XThe option \fB\-j\fR does not work for
  2181. Xfiles that contain lines with a single `.'.
  2182. SHAR_EOF
  2183. echo "extracting doc/ident.1l"
  2184. sed 's/^X//' << \SHAR_EOF > doc/ident.1l
  2185. X.TH IDENT 1L "" "Purdue University"
  2186. X.SH NAME
  2187. Xident \- identify files
  2188. X.SH SYNOPSIS
  2189. X\fBident\fR [ \fB\-q\fR ] [ file ... ]
  2190. X.SH DESCRIPTION
  2191. X.I Ident
  2192. Xsearches the named files or, if no file name appears, the standard input
  2193. Xfor all occurrences of the pattern
  2194. X\fI$keyword:...$\fR, where \fIkeyword\fR is one of
  2195. X.nf
  2196. X
  2197. X        Author
  2198. X        Date
  2199. X        Header
  2200. X        Id
  2201. X        Locker
  2202. X        Log
  2203. X        Revision
  2204. X        RCSfile
  2205. X        Source
  2206. X        State
  2207. X
  2208. X.fi
  2209. XThese patterns are normally inserted automatically by the RCS command
  2210. X.IR co (1L),
  2211. Xbut can also be inserted manually. The option \fB\-q\fR suppresses
  2212. Xthe warning given if there are no patterns in a file.
  2213. X.PP
  2214. X\fIIdent\fR works on text files as well as object files and dumps.
  2215. XFor example, if the C program in file f.c contains
  2216. X.nf
  2217. X
  2218. X        char rcsid[] = "$\&Header:  Header information $";
  2219. X
  2220. X.fi
  2221. Xand f.c is compiled into f.o, then the command
  2222. X.nf
  2223. X
  2224. X        ident  f.c  f.o
  2225. X
  2226. Xwill print
  2227. X
  2228. X        f.c:
  2229. X                $\&Header:  Header information $
  2230. X        f.o:
  2231. X                $\&Header:  Header information $
  2232. X
  2233. X.SH IDENTIFICATION
  2234. X.de VL
  2235. X\\$2
  2236. X..
  2237. XAuthor: Walter F. Tichy,
  2238. XPurdue University, West Lafayette, IN, 47907.
  2239. X.sp 0
  2240. XRevision Number:
  2241. X.VL $Revision: 1.2 $
  2242. X; Release Date:
  2243. X.VL $Date: 89/05/02 11:13:09 $
  2244. X\&.
  2245. X.sp 0
  2246. XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
  2247. X.SH SEE ALSO
  2248. Xci(1L), co(1L), rcs(1L), rcsdiff(1L), rcsintro(1L), rcsmerge(1L), rlog(1L), rcsfile(5L),
  2249. X.sp 0
  2250. XWalter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control
  2251. XSystem," in \fIProceedings of the 6th International Conference on Software
  2252. XEngineering\fR, IEEE, Tokyo, Sept. 1982.
  2253. SHAR_EOF
  2254. echo "extracting doc/merge.1l"
  2255. sed 's/^X//' << \SHAR_EOF > doc/merge.1l
  2256. X.TH MERGE 1L "" "Purdue University"
  2257. X.SH NAME
  2258. Xmerge \- three-way file merge
  2259. X.SH SYNOPSIS
  2260. X\fBmerge\fR [ \fB-p\fR ] file1 file2 file3
  2261. X.SH DESCRIPTION
  2262. X.I Merge
  2263. Xincorporates all changes that lead form \fIfile2\fR to \fIfile3\fR into 
  2264. X\fIfile1\fR. The result goes to std. output if \fB-p\fR is present, into 
  2265. X\fIfile1\fR otherwise. \fIMerge\fR is useful for combining separate changes 
  2266. Xto an original. Suppose \fIfile2\fR is the original, and both \fIfile1\fR 
  2267. Xand \fIfile3\fR are modifications of \fIfile2\fR. Then \fImerge\fR 
  2268. Xcombines both changes. 
  2269. X.PP
  2270. XAn overlap occurs if both \fIfile1\fR and \fIfile3\fR
  2271. Xhave changes in a common segment of lines.
  2272. X\fIMerge\fR prints how many overlaps occurred, and includes both alternatives
  2273. Xin the result. The alternatives are delimited as follows:
  2274. X.sp
  2275. X.nf
  2276. X        <<<<<<< file1
  2277. X        lines in file1
  2278. X        =======
  2279. X        lines in file3
  2280. X        >>>>>>> file3
  2281. X.fi
  2282. X.sp
  2283. XIf there are overlaps, the user should edit the result and delete one of the
  2284. Xalternatives.
  2285. X.SH IDENTIFICATION
  2286. X.de VL
  2287. X\\$2
  2288. X..
  2289. XAuthor: Walter F. Tichy,
  2290. XPurdue University, West Lafayette, IN, 47907.
  2291. X.sp 0
  2292. XRevision Number:
  2293. X.VL $Revision: 1.2 $
  2294. X; Release Date:
  2295. X.VL $Date: 89/05/02 11:13:46 $
  2296. X\&.
  2297. X.sp 0
  2298. XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
  2299. X.SH SEE ALSO
  2300. Xdiff3 (1), diff (1), rcsmerge (1L), co (1L).
  2301. SHAR_EOF
  2302. echo "End of archive 5 (of 14)"
  2303. # if you want to concatenate archives, remove anything after this line
  2304. exit
  2305.